]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
herbstluftwm: Search for a screen locker.
authorSimon Ruderich <simon@ruderich.org>
Wed, 12 Feb 2014 20:08:52 +0000 (21:08 +0100)
committerSimon Ruderich <simon@ruderich.org>
Wed, 12 Feb 2014 20:08:52 +0000 (21:08 +0100)
Display a warning if none is found.

herbstluftwm/autostart

index bc73fe402a6198deef9f6d920b0d190ca56ec0ad..22dbd0fb4b38f64dbf50fe44eeeffbcf20c9d5f6 100755 (executable)
@@ -57,9 +57,18 @@ hc keybind $mod-Shift-Return spawn urxvt
 hc keybind $mod-Shift-c close
 hc keybind $mod-q reload
 hc keybind $mod-Shift-q quit
+# Find an existing screen locker.
+for locker in xtrlock ''; do
+    if installed "$locker"; then
+        break
+    fi
+done
+if test -z "$locker"; then
+    echo 'No screen locker found!' | notify 60
+fi
 # Lock the screen. The sleep is necessary to allow xtrlock to grab the
 # keyboard input.
-hc keybind $mod-z spawn sh -c 'sleep 1 && exec xtrlock'
+hc keybind $mod-z spawn sh -c "sleep 1 && exec $locker"
 
 # Tag key bindings. Create tags 1 to 9 with bindings to switch and move
 # windows to them.