Page 5 of 5 FirstFirst ... 345
Results 41 to 43 of 43

Thread: How to make your laptop play sounds on lid open/close :)

  1. #41
    Join Date
    May 2011
    Location
    Golden, CO
    Beans
    96
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to make your laptop play sounds on lid open/close :)

    Quote Originally Posted by KIAaze View Post
    For the grep error, check if you have LID0 instead of LID like erick404.
    i.e. You should have "/proc/acpi/button/lid/LID0/state" or something similar somewhere.

    For the aplay error, it looks like aplay can't play your soundfile, so try to convert it to a compatible format or just use mplayer:

    So your code could be changed like this for instance:
    Code:
    grep -q closed /proc/acpi/button/lid/LID0/state
    if [ $? = 0 ]
    then
        mplayer /etc/acpi/cartman.wav;
    else
        mplayer /etc/acpi/myniga.wav;
    fi
    mplayer is in the repositories and supports mp3s.
    Code:
    sudo apt-get install mplayer
    For converting sound files, you can use ffmpeg I think, but I don't have that much experience with it.
    Seems like what you stated here was all correct. After changing to the "LID0" that error went away... but sadly, as in my previous post I stated that I cannot currently connect to the internet with my netbook (restrictions here at work in the middle of the ocean), I'm pretty much at an impass in regards to getting mplayer installed.

    I'll just have to wait until I'm back on dry land in about 8 days to get it all sorted
    Ubuntu 12.04 for personal use
    Solaris 9, 10 and Red Hat Ent 5 @ work

  2. #42
    Join Date
    May 2011
    Location
    Golden, CO
    Beans
    96
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to make your laptop play sounds on lid open/close :)

    Well I found some acceptable .wav files from StarCraft online and tranferred them to my netbook and updated the script with aplay.

    running ./lid.sh works

    However when i actually shut or close my netbook lid... nothing happens...???
    Ubuntu 12.04 for personal use
    Solaris 9, 10 and Red Hat Ent 5 @ work

  3. #43
    Join Date
    May 2011
    Location
    Golden, CO
    Beans
    96
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to make your laptop play sounds on lid open/close :)

    Well I got it finally to work when I close the lid, but not open...

    To do it, just changed the "closed" in the script to "open", so it looks like this:

    Code:
    grep -q open /proc/acpi/button/lid/LID0/state 
    if [ $? = 0 ] 
    then     
          aplay /etc/acpi/tbapss00.wav; 
    else     
          aplay /etc/acpi/pteWht03.wav;
     fi
    That being said, where and what would I change to make a specific sound when the login screen is displayed?
    Last edited by sectshun8; May 30th, 2011 at 11:42 AM.
    Ubuntu 12.04 for personal use
    Solaris 9, 10 and Red Hat Ent 5 @ work

Page 5 of 5 FirstFirst ... 345

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •