Page 2 of 6 FirstFirst 1234 ... LastLast
Results 11 to 20 of 57

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

  1. #11
    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 DougEdey View Post
    Firstly, let me say a big thankyou for this! It makes my life far easier at work when moving between my desk and our test floor.
    Your welcome. Sound like we have similar jobs...

    Quote Originally Posted by DougEdey View Post
    I was wondering if there's some way to link this into emesene (or amsn) to change my status? emesene has a dbus plugin so i thought it should be ok!
    To be honest I have never used amsn, but if you say it has a dbus interface then you should be fine. May be the same rules for running stuff as root or as the user would apply but it's a matter of figuring out what the commands are and how they work.

  2. #12
    Join Date
    Aug 2007
    Beans
    38

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

    Quote Originally Posted by lunatico View Post
    To be honest I have never used amsn, but if you say it has a dbus interface then you should be fine. May be the same rules for running stuff as root or as the user would apply but it's a matter of figuring out what the commands are and how they work.
    The problem is that I can't find anywhere that documents the DBUS interface

  3. #13
    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 DougEdey View Post
    The problem is that I can't find anywhere that documents the DBUS interface
    Same happened to me with Pidgin so I joined their mailing list and started asking questions until a developer gave me the answers. Try that.

  4. #14
    Join Date
    Aug 2009
    Beans
    2
    Distro
    Ubuntu 9.04 Jaunty Jackalope

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

    Awesome howto, thank you! I'll try it on my dell laptop.

  5. #15
    Join Date
    Dec 2006
    Beans
    6

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

    Hey, thanks for the tutorial. I implemented it and it worked just fine ... until I went to log out.

    When I shut down, the computer went through it's normal shutdown screens, the screen went blank, then stayed power up. I waited 5 mins and nothing. I had to hold down the power button for seven seconds to turn it all the way off. Then the next time I went to power up and log in, instead of the normal 30-45 seconds or so that it takes to get to the login screen, it took over 5 minutes. Once in, I did a little poking around in the forums about these problems, starting with the shutdown problem. I found this thread:

    http://ubuntuforums.org/showthread.php?t=1198992

    Talking about udev events and such, and I remembered going through your tutorial and entering the 80-thinkpad-T61.rules file. As an experiment, I moved the file out of /etc/udev/rules.d up one level, and what do you know, shutdown and power were back to normal. I repeated several times and sure enough, everything is fine and repeatable now.

    So, my question is, what is magical about this file that is causing my powerup/shutdown issues. Looking at the README in /etc/udev/rules.d, there is something about that number at the beginning of the file name, but by their description, 80 seems fine.

    Any ideas or tips you can offer?

    Thanks,
    Jim

  6. #16
    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
    So, my question is, what is magical about this file that is causing my powerup/shutdown issues. Looking at the README in /etc/udev/rules.d, there is something about that number at the beginning of the file name, but by their description, 80 seems fine.

    Any ideas or tips you can offer?
    Well as you could see 80 should be fine, the definition says:

    Code:
      80   rules that run programs (but do not load modules)
    But I have just checked on the computer I am at the moment (Thinkpad T61) and I have it down as /etc/udev/rules.d/60-thinkpad-T61.rules

    I can't remember from when I wrote the tutorial if the 80 was a mistake or what, but again, from that README file 80 seems ok.

    I'm assuming you are doing this on a Thinkpad right... not too sure what the behavior would be on other hardware.

    Hope this helps, sorry I don't have a more specific answer...

  7. #17
    Join Date
    Dec 2006
    Beans
    6

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

    Hey there, I'm running this on a T61p. I just changed the file name from an 80 to a 60 and the results are the same, slow boots and incomplete shutdowns.

    I'll do some research and if I find a solution, I'll post it here on the thread.

    Thanks for our help.

  8. #18
    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
    I'll do some research and if I find a solution, I'll post it here on the thread.
    Me too! Lets make this a contest, the one who finds the solution first wins!!! HAHA

    Anyway, I just tried this on a T61p and same story... So something changed from Ubuntu 8.10 to 9.04 because it was working fine on the T61p on 8.10.

    Do not despair, we shall fix this!

  9. #19
    Join Date
    Dec 2006
    Beans
    6

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

    Well, I've played around with this a little bit. I turned off the splash screen during bootup so I could see where things get hung up. I booted into 3 different kernels from grub:

    2.6.28-15 (default)
    2.6.28-14
    2.6.27-11

    For all three, the boot hung for several minutes at the following lines:

    [26.xxxxxx] IBM TrackPoint firmware: 0x0e, buttons: 3/3
    [26.xxxxxx] input: TPPS/2 IBM TrackPoint as /devices/platform/i8042/serio1/serio2/input/input12

    Without the 80- (or 60-) rule file in place in /etc/udev/rules.d, the boot up sequence moves through this step with no problem.

    That's as much as I've had time to do, just putting it out there to see if it sparks any ideas.
    Last edited by nhmtnbkr; August 28th, 2009 at 03:31 PM.

  10. #20
    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

    Found the solution to the startup delay!

    Delete the file 80-thinkpad-T61.rules by:

    Code:
    sudo rm /etc/udev/rules.d/80-thinkpad-T61.rules
    And instead of that we will catch the dock/undock with the following udev rule by:

    Code:
    gksudo gedit /lib/udev/rules.d/85-thinkpad-T61.rules
    And paste the following:

    Code:
    KERNEL=="dock.0", ACTION=="change", RUN+="/etc/thinkpad/dock.sh"
    The rest should be the same as we are still calling the dock.sh script.

    Restart hal to immediately see the changes.

Page 2 of 6 FirstFirst 1234 ... 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
  •