This commit is contained in:
2026-07-29 20:10:58 +07:00
parent 6aecda3c0a
commit 811b94ed72
2 changed files with 15 additions and 2 deletions
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
wall_dir="${1:?wallpaper directory required}"
img=$(find "$wall_dir" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | shuf -n1)
tmp=/tmp/lockscreen.png
res=$(xrandr --current | awk '/ connected/ {getline; print $1; exit}')
: "${res:=1920x1080}"
if [ -n "$img" ] && convert "$img" -resize "${res}^" -gravity Center -extent "$res" "$tmp" 2>/dev/null; then
i3lock -i "$tmp"
else
i3lock -c 000000
fi
systemctl suspend