diff --git a/i3/config b/i3/config index 69ede67..724f67e 100644 --- a/i3/config +++ b/i3/config @@ -106,6 +106,9 @@ bindsym $mod+r mode "resize" # Lock the computer bindsym $mod+l exec /bin/bash ~/.config/i3/scripts/i3lock.sh +# Lock the computer +bindsym $mod+shift+l exec /bin/bash ~/.config/i3/scripts/suspend.sh + ############################################ # Application Keys # ############################################ diff --git a/i3/scripts/suspend.sh b/i3/scripts/suspend.sh new file mode 100644 index 0000000..dce6fd0 --- /dev/null +++ b/i3/scripts/suspend.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# check if locked +if !(pgrep -x "i3lock" > /dev/null) +then + bash ~/.config/i3/scripts/i3lock.sh +fi + +systemctl suspend \ No newline at end of file