Page 3 of 6 FirstFirst 12345 ... LastLast
Results 21 to 30 of 57

Thread: [HOWTO] Run scripts for laptop lid open/close and dock/undock events

  1. #21
    Join Date
    Dec 2006
    Beans
    6

    Re: [HOWTO] Run scripts for laptop lid open/close and dock/undock events

    Thanks man, that worked perfectly!

    A couple of things. First, would you mind shooting me an explanation as to why this works and the previous incarnation did not (or was slow).

    Second, I've run into another problem. Just curious, but while you're docked, do you have an external monitor setup? If so, is it configured in Xinerama mode? I just set this up, and when I do lid open/close or dock/undock, my computer locks up tight. No access whatsoever. I have to hold down the power button for 7 secs to turn it off then power on. Just for grins, I went back and tried it with the old rule (80-...) and it did the same thing. I've done a cursory search and it seems folks run some scripts to change enabled screens, etc. when docking and undocking, I was just wondering if you've run into this before I dive deeper.

    Thanks again.

  2. #22
    Join Date
    Dec 2007
    Location
    Galway, Ireland
    Beans
    316
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [HOWTO] Run scripts for laptop lid open/close and dock/undock events

    Quote Originally Posted by nhmtnbkr View Post
    Thanks man, that worked perfectly!
    You're very welcome.

    Quote Originally Posted by nhmtnbkr View Post
    ... First, would you mind shooting me an explanation as to why this works and the previous incarnation did not (or was slow)...
    Don't you think I did it by myself, I had some help. Have a look at this thread.

    That lead me to read more about how udev works and stuff.

    You should join that mailing list, people is very helpful and they know a lot.

    Quote Originally Posted by nhmtnbkr View Post
    ... I've run into another problem. Just curious, but while you're docked, do you have an external monitor setup? If so, is it configured in Xinerama mode? ....
    I do have an external monitor...

    Not familiar with xinerama sorry... My video card is an Nvidia, and the way I have it configured is that my external monitor is a clone of my laptop screen, and for the lid event I have it to do nothing from Power Management options. I use clone and not extended desktop because I already have 4 workspaces which is virtually 4 desktops.

    Wish I could help more....

  3. #23
    Join Date
    Sep 2008
    Location
    United Kingdom, Kent
    Beans
    129
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [HOWTO] Run scripts for laptop lid open/close and dock/undock events

    I'm trying to make sounds play when opening/closing and i can't get this to work. I've tried this guide as well as http://ubuntuforums.org/showthread.php?t=563687
    are there some commands that can detect problems?
    i tried running cat /proc/acpi/button/lid/LID/state and it detects the lid state as open.
    Customize bash commands/Unknown Process/I love LoL/'Keep Aligned' Stuck
    Red/cyan* means top priority
    *only if you have compiz negative turned on

  4. #24
    Join Date
    Dec 2007
    Location
    Galway, Ireland
    Beans
    316
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [HOWTO] Run scripts for laptop lid open/close and dock/undock events

    Quote Originally Posted by SlickRick View Post
    are there some commands that can detect problems?
    Well the easiest way is to try each part separately. You can also put some output with echo on your scripts so that when you run them you can see where they are failing. Are you getting errors?

    If you run your ~/open and ~/close scripts do they work?
    If yes, then is your ~/lid_event script running properly and calling them?

  5. #25
    Join Date
    Sep 2008
    Location
    United Kingdom, Kent
    Beans
    129
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [HOWTO] Run scripts for laptop lid open/close and dock/undock events

    I tried running each script separately and I always get the sound playing with no errors, although I do have to put my password in to run them.
    I tried echo after each line in the scripts and it seems the lid_event script is wrong since it made the closing sound play when I ran it
    Customize bash commands/Unknown Process/I love LoL/'Keep Aligned' Stuck
    Red/cyan* means top priority
    *only if you have compiz negative turned on

  6. #26
    Join Date
    Dec 2007
    Location
    Galway, Ireland
    Beans
    316
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [HOWTO] Run scripts for laptop lid open/close and dock/undock events

    Quote Originally Posted by SlickRick View Post
    I tried running each script separately and I always get the sound playing with no errors, although I do have to put my password in to run them.
    Yes because they are meant to be run by root. The lid events are generated by kernel event owned by root. Try running them as root and they should work fine without even asking for password.

    I tried echo after each line in the scripts and it seems the lid_event script is wrong since it made the closing sound play when I ran it[/QUOTE]

    Mmm what hardware are you on?

  7. #27
    Join Date
    Sep 2008
    Location
    United Kingdom, Kent
    Beans
    129
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [HOWTO] Run scripts for laptop lid open/close and dock/undock events

    Still get asked the password if i run them as root and still the lid gets detected as closed

    I've got a Toshiba satellite L300-18E
    Here are the full specs
    Customize bash commands/Unknown Process/I love LoL/'Keep Aligned' Stuck
    Red/cyan* means top priority
    *only if you have compiz negative turned on

  8. #28
    Join Date
    Dec 2007
    Location
    Galway, Ireland
    Beans
    316
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [HOWTO] Run scripts for laptop lid open/close and dock/undock events

    Quote Originally Posted by SlickRick View Post
    I've got a Toshiba satellite L300-18E
    This was written for Thinkpads (T61 and T61p)...
    You will have to find out what's going under the hood on your toshiba, I don't have one, sorry I can't help you.

  9. #29
    Join Date
    Sep 2008
    Location
    United Kingdom, Kent
    Beans
    129
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [HOWTO] Run scripts for laptop lid open/close and dock/undock events

    maybe theres a way i can periodically run cat /proc/acpi/button/lid/LID/state and then open and close the lid and see if the computer is detecting the change?
    also, what do you mean 'find out what's going under the hood on your toshiba'? I posted a link to my specs if that's what you mean, although I hardly see how my hardware would make any difference.

    btw, BUMP
    Customize bash commands/Unknown Process/I love LoL/'Keep Aligned' Stuck
    Red/cyan* means top priority
    *only if you have compiz negative turned on

  10. #30
    Join Date
    Dec 2007
    Location
    Galway, Ireland
    Beans
    316
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [HOWTO] Run scripts for laptop lid open/close and dock/undock events

    Quote Originally Posted by SlickRick View Post
    also, what do you mean 'find out what's going under the hood on your toshiba'?
    Hardware and hardware events are exposed to the OS in many different ways...

    Quote Originally Posted by SlickRick View Post
    I posted a link to my specs if that's what you mean,
    Well but that's something you'll have to do by yourself. I don't have such hardware to test on... nor the time.

    Quote Originally Posted by SlickRick View Post
    although I hardly see how my hardware would make any difference.
    It will be different. When you install an OS it is installed to match your hardware, the best way possible...


    Are you sure you have the /etc/acpi/lid.sh script? Was it there already? Is it running each time you open and close your lid?

    Try:

    Code:
    touch test
    Code:
    gksudo gedit /etc/acpi/lid.sh
    and right after line #!/bin/bash put this

    Code:
    echo 1 >> test
    Save and close.

    Open and close your lid, for each time you do it it should be adding a 1 to the test file. If 1s are been added then you did something wrong when following the steps in this tutorial, if not then Ubuntu uses a different way to capture your lid event.

Page 3 of 6 FirstFirst 12345 ... LastLast

Tags for this Thread

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
  •