Ver código fonte

Update lock-screen command

Samuel W. Flint 1 ano atrás
pai
commit
40cacb2215
1 arquivos alterados com 11 adições e 2 exclusões
  1. 11 2
      lock-screen

+ 11 - 2
lock-screen

@@ -17,13 +17,22 @@ case ${1} in
         xidlehook-client --socket ~/.xidlehook.sock \
                          control --action trigger --timer 0
         ;;
-    start)
-        rm ~/.xidlehook.sock
+    daemon)
+        [ -e ~/.xidlehook.sock ] && rm ~/.xidlehook.sock
+        echo "Starting xidlehook"
         xidlehook --socket ~/.xidlehook.sock \
                   --not-when-fullscreen \
                   --not-when-audio \
+                  --detect-sleep \
                   --timer 300 "lock-screen locker-command" ""
         ;;
+    start)
+        if ! ps aux | grep ' [x]idlehook ' > /dev/null ; then
+            if ! tmux has-session -t 'screenlocker' ; then
+                tmux new-session -s 'screenlocker' -n 'screenlocker' -d "$SHELL -c 'lock-screen daemon'"
+            fi
+        fi
+        ;;
     disable)
         xidlehook-client --socket ~/.xidlehook.sock \
                          control --action disable --timer 0