Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want Ctrl+Alt+L and being idle to trigger

dm-tool switch-to-greeter

(goes to login screen)

instead of lock screen I intend to replace every event where lockscreen would appear to show login screen(but still logged in)

how do I do it?

share|improve this question
I have 12.04 TLS according to my help file – Jani Kovacs Jan 28 '14 at 16:28

To create the shortcut

  • Go to the Settings Manager from the menu.
  • Go to Keyboard.
  • In the Application Shortcuts tab press on Add.
  • Enter dm-tool switch-to-greeter then press OK.
  • Press the desired hotkey.

To run a command after 2 idle minutes

  • Create a bash script, containing:

# The target may depend on your system. i8042 is mouse and keyboard on mine.

    interrupts_start=`grep $target $log | awk '{ print $2 }'`
    interrupts_stop=`sleep 1 && grep $target $log | awk '{ print $2 }'`

    if [ "$interrupts_start" == "$interrupts_stop" ] ; then
        if [ $count -eq 120 ] ; then
            dm-tool switch-to-greeter
            measure_activity 0
            measure_activity $count

measure_activity 0 &
  • Make it executable.

  • Add it to Application Autostart tab of Session and Startup.

P.S.: I've got the script from here and I edited it for you.

share|improve this answer
thank you this part works, but I also want to go to greeter after being idle for 2 minutes or so. – Jani Kovacs Jan 28 '14 at 16:35
You're right. I didn't see the second part of the question the first time I read it. Now I hope that my answer is complete. – qxp Jan 28 '14 at 17:45
For me it goes to greeter regardless of me moving the mouse or not.. I guess it is because target is not i8042 for me – Jani Kovacs Jan 28 '14 at 19:36
Open /proc/interrupts, move the mouse then open it again. Compare the two logs. The last column is the input, you want to change instead of i8042. Figure out which row you need. It must have different values between the two logs in the first column to be the row, corresponding to mouse movements. It should be one of the "usb" ones. – qxp Jan 29 '14 at 20:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.