From 81433c59c2a086c08d40b2589d80a9c8401120ef Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Fri, 3 Nov 2017 03:26:11 -0400 Subject: [PATCH] Add a first attempt at xautolock config --- .config/i3/config | 4 +++- .config/i3/lock.sh | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.config/i3/config b/.config/i3/config index 4e94824..2425542 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -13,6 +13,8 @@ exec --no-startup-id pasystray -a exec --no-startup-id udiskie -s0 exec --no-startup-id caffeine exec --no-startup-id thunderbird +exec --no-startup-id xset s off dpms 0 0 0 +exec --no-startup-id xautolock -time 5 -locker "~/.config/i3/lock.sh lock 1" -detectsleep # keyboard settings exec --no-startup-id setxkbmap -option 'ctrl:nocaps' @@ -32,7 +34,7 @@ bindsym $mod+e exec emacsclient -c -n # start emacs bindsym $mod+Shift+e exec thunderbird # start thunderbird bindsym Mod1+Mod4+s exec $config_dir/lock.sh suspend # suspend -bindsym Mod1+Control+l exec $config_dir/lock.sh lock # lock screen +bindsym Mod1+Control+l exec $config_dir/lock.sh lock 5 # lock screen bindsym Mod1+Control+Delete exec $config_dir/lock.sh pick # power menu bindsym $mod+p exec --no-startup-id $config_dir/killPanel.sh # restart xfce4-panel diff --git a/.config/i3/lock.sh b/.config/i3/lock.sh index bcfc969..578e501 100755 --- a/.config/i3/lock.sh +++ b/.config/i3/lock.sh @@ -17,6 +17,13 @@ lock() { case "$1" in lock) lock + + # if given an argument, turn off the screen after that many seconds + if [[ $2 && ${2-x} ]] + then + sleep $2 + xset dpms force off + fi ;; logout) i3-msg exit