Results 1 to 4 of 4

Thread: Running command after lock screen

  1. #1
    Join Date
    Jun 2010
    Location
    UK
    Beans
    5
    Distro
    Ubuntu 11.04 Natty Narwhal

    Question Running command after lock screen

    So I have a script that runs from 'Startup Applications'. That works fine. However, I also want it to run after I unlock a locked screen such as after suspend or a screensaver. I have mod3+t as a shortcut to it, but it would be nice if I could get it to run automatically.

  2. #2
    Join Date
    Jul 2010
    Location
    Australia
    Beans
    13

    Re: Running command after lock screen

    I'm bumping this because I also would like to know how to make a command run after I unlock the screen.

    (I would like to use purple-remote to set my Pidgin status to Away when I lock the screen and Available when I unlock...)

  3. #3
    Join Date
    Jul 2010
    Location
    Australia
    Beans
    13

    Re: Running command after lock screen

    Okay, figured it out. Use a while-loop like so:

    Code:
    while [ "`gnome-screensaver-command --query | head -1`" = "The screensaver is active" ]; do
    sleep 4
    done
    
    # Put here some commands to run after unlocking...
    Last edited by necrosymbiont; February 18th, 2011 at 04:26 AM. Reason: Code block didn't render correctly.

  4. #4
    Join Date
    Feb 2008
    Beans
    1

    Re: Running command after lock screen


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
  •