commit f245110f53f093552d32b5fd4abc7c1d5a62a307 parent e73e6202cc1456b53c28fe5f322fdad4d70acb42 Author: Daniel Moch <daniel@danielmoch.com> Date: Tue, 30 Jan 2018 19:03:37 -0500 my: Simplify lock and suspend logic Diffstat:
M | .local/bin/my | | | 15 | ++++----------- |
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/.local/bin/my b/.local/bin/my @@ -64,13 +64,9 @@ case $command in locker=`__getlocker` - [ -z "$locker" ] && exit 1 - if [ "$locker" = "light-locker" ] - then - exec xset dpms force off - else - exec $locker-command -l - fi + [ -z "$locker" ] && __mylog "my lock" "no locker running"; exit 1 + [ "$locker" = "light-locker" ] || $locker-command -l + exec xset dpms force off ;; wallpaper) xsetroot -solid "#444444" @@ -81,10 +77,7 @@ case $command in then locker=`__getlocker` [ -z "$locker" ] && exit 1 - if [ ! "$locker" = "light-locker" ] - then - $locker-command -l - fi + [ "$locker" = "light-locker" ] || $locker-command -l exec systemctl hybrid-sleep else __mylog "my standby" "No handler found"