Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've got an Ubuntu 12.04 system with Awesome WM, and I'd like the screensaver to work like in Unity:

  1. GNOME Screensaver
  2. Ctrl-Alt-L to lock
  3. N minutes' timeout which respects applications which temporarily disable the screensaver

The keyboard shortcut was relatively easy:

-- Lock screen
awful.key(
    { "Mod1", "Control" },
    "l",
    function ()
        awful.util.spawn("gnome-screensaver-command --lock")
    end)

How do I solve point 3?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

You could use xautolock:

Xautolock monitors console activity under the X window system, and fires up a program of your choice if nothing happens during a user configurable period of time. You can use this to automatically start up a screen locker in case you tend to forget to do so manually before having a coffee break.

Something along the lines of:

xautolock -time 10 -locker "gnome-screensaver-command --lock"

The only application that I have found that doesn't respect xautolock is VLC; but mplayer works nicely with it.

share|improve this answer
1  
Are you sure mplayer works nicely? I'm currently using mplayer-1.1(svn) and xautolock still triggers the locker while playing a video. –  Unode Dec 3 '12 at 1:27
    
At the time I wrote this answer, yes mplayer worked with xautolock. An update sometime since has meant this is no longer the case. Hopefully, it is a temporary aberration. –  jasonwryan Dec 3 '12 at 2:36

This is a fairly old post - but there's a good explanation on how to use xautolock together with i3lock here:

http://rabexc.org/posts/awesome-xautolock-battery

share|improve this answer
    
It is often customary to paste some of the important information from a link inline. You may want to consider doing so. –  HalosGhost Jun 24 at 17:32

Your Answer

 
discard

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.