commit db52dd688152cabc9570b19f3d450440be63e695
parent ddbdec36a81ba889a1fe53b0c8440104e66ff7f7
Author: oscarbenedito <oscar@oscarbenedito.com>
Date: Sun, 26 Apr 2020 20:52:04 +0200
New lock script to make lock screen match wallpaper
Diffstat:
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/dot_config/i3/config b/dot_config/i3/config
@@ -178,7 +178,7 @@ bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcu
bindsym $mod+i mode "$mode_system"
set $mode_system (l)ock, (e)xit, (r)eboot, (s)hutdown
mode "$mode_system" {
- bindsym l exec --no-startup-id "i3lock -i $wp", mode "default"
+ bindsym l exec --no-startup-id "$HOME/.local/bin/,i3-lock", mode "default"
bindsym e exec --no-startup-id "i3-msg exit", mode "default"
bindsym r exec --no-startup-id "systemctl reboot", mode "default"
bindsym s exec --no-startup-id "systemctl poweroff", mode "default"
diff --git a/dot_local/bin/executable_,i3-lock b/dot_local/bin/executable_,i3-lock
@@ -0,0 +1,12 @@
+#!/usr/bin/env sh
+
+DIMS="$(xdpyinfo | grep dimensions | awk '{print $2}')"
+WALL="$XDG_CONFIG_HOME/i3/wallpaper.png"
+OUTDIR="$XDG_CACHE_HOME/i3/wallpapers"
+OUT="$OUTDIR/$DIMS.png"
+
+[ -f "$OUT" ] && i3lock -i "$OUT" && exit
+[ ! -f "$WALL" ] && i3lock -c 142a3a && exit
+[ ! -d "$OUTDIR" ] && mkdir --parents $OUTDIR
+convert -resize "$DIMS^" -gravity center -extent "$DIMS" $WALL $OUT
+i3lock -i "$OUT"