Add wallpaper rotation (4 wallpapers), fuzzel launcher, fix SSH/laptop.nix syntax
This commit is contained in:
parent
125edddec7
commit
cbd86ec79e
8 changed files with 33 additions and 3 deletions
|
|
@ -233,4 +233,8 @@
|
|||
[urgency_normal] background = "#1e1e2e"; foreground = "#cdd6f4"; timeout = 5
|
||||
[urgency_critical] background = "#f38ba8"; foreground = "#1e1e2e"; timeout = 0
|
||||
'';
|
||||
# === Wallpaper rotation ===
|
||||
home.file.".local/bin/wallpaper-rotate" = {
|
||||
source = ./wallpaper-rotate.sh;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ exec-once = dunst
|
|||
exec-once = wl-paste --type text --watch cliphist store
|
||||
exec-once = wl-paste --type image --watch cliphist store
|
||||
exec-once = hypridle
|
||||
exec-once = awww
|
||||
exec-once = sleep 1 && ~/.local/bin/wallpaper-rotate
|
||||
|
||||
input {
|
||||
kb_layout = us
|
||||
|
|
|
|||
23
home/wallpaper-rotate.sh
Normal file
23
home/wallpaper-rotate.sh
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env bash
|
||||
set -o pipefail
|
||||
|
||||
# Wallpapers are in the laptop-config repo
|
||||
WALLPAPER_DIR="$HOME/laptop-config/wallpapers"
|
||||
CACHE_FILE="$HOME/.cache/current-wallpaper"
|
||||
|
||||
mapfile -t wallpapers < <(find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname "*.png" -o -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.gif" \) | sort)
|
||||
count="${#wallpapers[@]}"
|
||||
|
||||
if [ "$count" -eq 0 ]; then
|
||||
echo "No wallpapers found in $WALLPAPER_DIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
current=$(cat "$CACHE_FILE" 2>/dev/null || echo "")
|
||||
chosen="$current"
|
||||
while [ "$chosen" = "$current" ] && [ "$count" -gt 1 ]; do
|
||||
chosen="${wallpapers[$((RANDOM % count))]}"
|
||||
done
|
||||
|
||||
echo "$chosen" > "$CACHE_FILE"
|
||||
awww img "$chosen"
|
||||
Loading…
Add table
Add a link
Reference in a new issue