diff --git a/.config/i3/LockScreen.png b/.config/i3/LockScreen.png new file mode 100644 index 0000000..1cc0c34 Binary files /dev/null and b/.config/i3/LockScreen.png differ diff --git a/.config/i3/config b/.config/i3/config index 7437087..d5dea19 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -10,7 +10,6 @@ exec --no-startup-id redshift-gtk -l 43:-72 exec --no-startup-id insync start exec --no-startup-id syncthing-gtk exec --no-startup-id start-pulseaudio-x11 && sleep 10 && volumeicon -exec --no-startup-id xss-lock -l /home/adam/.bin/i3lock-wrapper.sh exec --no-startup-id udiskie -s0 exec --no-startup-id caffeine exec --no-startup-id thunderbird @@ -32,10 +31,10 @@ bindsym $mod+Return exec roxterm # start a termin bindsym $mod+e exec emacsclient -c -n # start emacs bindsym $mod+Shift+e exec thunderbird # start thunderbird -bindsym Mod1+Mod4+s exec /home/adam/.bin/lock.sh suspend # suspend -bindsym Mod1+Control+l exec /home/adam/.bin/lock.sh lock # lock screen -bindsym Mod1+Control+Delete exec /home/adam/.bin/lock.sh pick # power menu -bindsym $mod+p exec --no-startup-id ~/.bin/killPanel.sh # restart xfce4-panel +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+Delete exec $config_dir/lock.sh pick # power menu +bindsym $mod+p exec --no-startup-id ~/.bin/killPanel.sh # restart xfce4-panel mode "launch" { bindsym e exec emacsclient -c -n; mode "default" diff --git a/.config/i3/lock.sh b/.config/i3/lock.sh new file mode 100755 index 0000000..56021ed --- /dev/null +++ b/.config/i3/lock.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +lock() { + killall -SIGHUP gpg-agent + setxkbmap -option 'ctrl:nocaps' -option "shift:both_capslock" + i3lock -i /home/adam/.config/i3/LockScreen.png -ec222222 +} + +case "$1" in + lock) + lock + ;; + logout) + i3-msg exit + ;; + suspend) + lock && systemctl suspend + ;; + hibernate) + lock && systemctl hibernate + ;; + reboot) + systemctl reboot + ;; + shutdown) + systemctl poweroff + ;; + pick) + $0 $(echo -e "lock\nlogout\nsuspend\nhibernate\nreboot\nshutdown" | rofi -dmenu -i -bg '#222222' -fg '#cccccc' -fg-active '#ffffff') + ;; + *) + echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown|pick}" + exit 2 + ;; +esac + +exit 0