diff --git a/.config/i3/config b/.config/i3/config index 506009f..fd94d6f 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -152,6 +152,9 @@ bindsym $mod+r mode "resize" # Screenshot bindsym Print exec scrot -e 'mv $f ~/pictures/ 2>/dev/null' +# Screen lock +bindsym control+l exec 'lock' + # Start i3bar to display a workspace bar (plus the system information i3status # finds out, if available) bar { diff --git a/bin/lock b/bin/lock new file mode 100755 index 0000000..2bca112 --- /dev/null +++ b/bin/lock @@ -0,0 +1,11 @@ +#!/bin/sh + +set -euo pipefail +IFS=$'\n\t' + +LOCK_BG_FILE="/tmp/lock_screen.png" + +scrot "$LOCK_BG_FILE" +mogrify -filter Gaussian -resize 50% -define filter:sigma=2.5 -resize 200% "$LOCK_BG_FILE" +mogrify -font Liberation-Sans -fill white -undercolor '#00000080' -pointsize 30 -gravity South -annotate +0+200 "Screen locked" "$LOCK_BG_FILE" +i3lock -e -i "$LOCK_BG_FILE"