From ba31b019ce0cb3e1d8115fe38f440344ba770dbb Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Wed, 12 Feb 2014 21:08:52 +0100 Subject: [PATCH] herbstluftwm: Search for a screen locker. Display a warning if none is found. --- herbstluftwm/autostart | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/herbstluftwm/autostart b/herbstluftwm/autostart index bc73fe4..22dbd0f 100755 --- a/herbstluftwm/autostart +++ b/herbstluftwm/autostart @@ -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. -- 2.44.1