mirror of
https://github.com/fscotto/infra.git
synced 2026-05-30 15:39:58 +00:00
Rewrite i3lock lockscreen with wallpaper, cover resize and caching
- Replace screenshot+blur with static wallpaper (void-minimalist.png) - Resize to display resolution with cover mode (resize^ + extent) - Cache resized image in ~/.cache/i3lock/ to avoid re-encoding - Invalidate cache when wallpaper or resolution changes - Add xdotool to void_packages_base for display geometry detection
This commit is contained in:
@@ -35,6 +35,7 @@ void_packages_base:
|
|||||||
- socklog-void
|
- socklog-void
|
||||||
- tmux
|
- tmux
|
||||||
- ufw
|
- ufw
|
||||||
|
- xdotool
|
||||||
- void-repo-nonfree
|
- void-repo-nonfree
|
||||||
- vpm
|
- vpm
|
||||||
- vsv
|
- vsv
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ font pango:Liberation Mono 10
|
|||||||
exec --no-startup-id dex --autostart --environment i3
|
exec --no-startup-id dex --autostart --environment i3
|
||||||
exec --no-startup-id gnome-keyring-daemon --start --components=secrets
|
exec --no-startup-id gnome-keyring-daemon --start --components=secrets
|
||||||
exec_always --no-startup-id setxkbmap -layout us -variant intl
|
exec_always --no-startup-id setxkbmap -layout us -variant intl
|
||||||
exec_always --no-startup-id feh --bg-fill ~/.config/i3/wallpapers/dont_like_wallpapers.jpg
|
exec_always --no-startup-id feh --bg-fill ~/.config/i3/wallpapers/void-minimalist2.png
|
||||||
exec_always --no-startup-id ~/.config/i3/scripts/setup-gtk-theme.sh
|
exec_always --no-startup-id ~/.config/i3/scripts/setup-gtk-theme.sh
|
||||||
exec --no-startup-id /usr/libexec/xdg-desktop-portal
|
exec --no-startup-id /usr/libexec/xdg-desktop-portal
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,20 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
img=/tmp/lockscreen.png
|
wallpaper="$HOME/.config/i3/wallpapers/void-minimalist.png"
|
||||||
|
cached="$HOME/.cache/i3lock/wallpaper.png"
|
||||||
|
dims_cache="$HOME/.cache/i3lock/dims.txt"
|
||||||
|
dims=$(xdotool getdisplaygeometry | tr ' ' 'x')
|
||||||
|
|
||||||
# screenshot
|
if [ ! -f "$cached" ] || \
|
||||||
scrot "$img"
|
[ "$(stat -c %Y "$wallpaper")" -gt "$(stat -c %Y "$cached")" ] || \
|
||||||
|
[ "$dims" != "$(cat "$dims_cache" 2>/dev/null)" ]; then
|
||||||
|
mkdir -p "$HOME/.cache/i3lock"
|
||||||
|
convert "$wallpaper" -resize "$dims^" -extent "$dims" PNG:- > "$cached"
|
||||||
|
echo -n "$dims" > "$dims_cache"
|
||||||
|
fi
|
||||||
|
|
||||||
# blur
|
|
||||||
convert "$img" -blur 0x8 "$img"
|
|
||||||
|
|
||||||
# lock
|
|
||||||
i3lock \
|
i3lock \
|
||||||
--image "$img" \
|
--image "$cached" \
|
||||||
--clock \
|
--clock \
|
||||||
--indicator \
|
--indicator \
|
||||||
--radius 100 \
|
--radius 100 \
|
||||||
|
|||||||
BIN
dotfiles/desktop/.config/i3/wallpapers/void-minimalist.png
Normal file
BIN
dotfiles/desktop/.config/i3/wallpapers/void-minimalist.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
BIN
dotfiles/desktop/.config/i3/wallpapers/void-minimalist2.png
Normal file
BIN
dotfiles/desktop/.config/i3/wallpapers/void-minimalist2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 MiB |
Reference in New Issue
Block a user