commit
Add more stuff lul
diff --git a/README.md b/README.md
index 21ba1cb..391f52d 100644
--- a/README.md
+++ b/README.md
@@ -46,6 +46,7 @@ Anything already in the way is renamed to `.bak-<date>`, never deleted.
| Bluetooth | Bluetooth on/off | Open bluetui | |
| Volume | Mute | Open pavucontrol | |
| CPU / RAM | Open btop | | |
+| Picture icon (next to the logo) | Still / animated wallpaper | | |
## Tested on
diff --git a/binaries/wallpaper b/binaries/wallpaper
new file mode 100755
index 0000000..2b09186
--- /dev/null
+++ b/binaries/wallpaper
@@ -0,0 +1,43 @@
+#!/bin/sh
+# wallpaper: switch between the still and the animated wallpaper.
+#
+# wallpaper toggle flip static <-> animated (the waybar decor button)
+# wallpaper static still image only
+# wallpaper animated play sway/background.webm on top of the still
+# wallpaper restore start whichever mode was last chosen (run at login)
+# wallpaper status JSON for the waybar button
+#
+# The still (sway/config "output * bg") always runs underneath, so stopping
+# the video just reveals it. mpvpaper pauses itself while windows cover it.
+
+VIDEO="$HOME/.config/sway/background.webm"
+STATE="${XDG_STATE_HOME:-$HOME/.local/state}/wallpaper-mode"
+
+mode() { cat "$STATE" 2>/dev/null || echo static; }
+save() { mkdir -p "$(dirname "$STATE")"; echo "$1" > "$STATE"; }
+refresh() { pkill -RTMIN+9 -x waybar; }
+
+start_video() {
+ pgrep -x mpvpaper >/dev/null && return 0
+ if ! command -v mpvpaper >/dev/null; then
+ notify-send "Animated wallpaper" "mpvpaper isn't installed (run install-deps.sh)"
+ return 1
+ fi
+ [ -f "$VIDEO" ] || { notify-send "Animated wallpaper" "Missing $VIDEO"; return 1; }
+ setsid -f mpvpaper -p -o "no-audio loop hwdec=auto panscan=1.0" '*' "$VIDEO" \
+ >/dev/null 2>&1
+}
+
+case ${1:-status} in
+ static) pkill -x mpvpaper; save static; refresh ;;
+ animated) start_video && save animated; refresh ;;
+ toggle) if [ "$(mode)" = animated ]; then "$0" static; else "$0" animated; fi ;;
+ restore) [ "$(mode)" = animated ] && start_video ;;
+ status)
+ if [ "$(mode)" = animated ]; then
+ printf '{"text":"<span color=\\"#5FD4F0\\">\\udb82\\udd3a</span>","tooltip":"Animated wallpaper (click for still)","class":"animated"}\n'
+ else
+ printf '{"text":"<span color=\\"#E0485C\\">\\udb80\\udee9</span>","tooltip":"Still wallpaper (click to animate)","class":"static"}\n'
+ fi ;;
+ *) sed -n '2,10p' "$0" | sed 's/^# \{0,1\}//'; exit 1 ;;
+esac
diff --git a/install-deps.sh b/install-deps.sh
index 7464e5d..87954d8 100755
--- a/install-deps.sh
+++ b/install-deps.sh
@@ -62,7 +62,7 @@ echo "Detected ${PRETTY_NAME:-$ID} (using the $FAMILY package list)"
# apps, portals, build tools for the cargo steps below.
case $FAMILY in
void)
- PKGS=(swayfx Waybar swaybg swayidle autotiling polkit-gnome gnome-keyring
+ PKGS=(swayfx Waybar swaybg mpvpaper swayidle autotiling polkit-gnome gnome-keyring
mako libnotify fuzzel gtklock ImageMagick kitty yazi
wl-clipboard cliphist pipewire wireplumber pavucontrol
brightnessctl playerctl power-profiles-daemon
@@ -70,7 +70,7 @@ void)
grim slurp wf-recorder firefox flatpak xdg-desktop-portal-wlr
jq curl unzip git fontconfig rustup) ;;
arch)
- PKGS=(swayfx waybar swaybg swayidle autotiling polkit-gnome gnome-keyring
+ PKGS=(swayfx waybar swaybg mpvpaper swayidle autotiling polkit-gnome gnome-keyring
mako libnotify fuzzel gtklock imagemagick kitty yazi
wl-clipboard cliphist pipewire pipewire-pulse wireplumber pavucontrol
brightnessctl playerctl power-profiles-daemon
@@ -78,7 +78,7 @@ arch)
grim slurp wf-recorder firefox flatpak xdg-desktop-portal-wlr
jq curl unzip git fontconfig base-devel rustup) ;;
fedora)
- PKGS=(swayfx waybar swaybg swayidle autotiling polkit-gnome gnome-keyring
+ PKGS=(swayfx waybar swaybg mpvpaper swayidle autotiling polkit-gnome gnome-keyring
mako libnotify fuzzel gtklock ImageMagick kitty yazi
wl-clipboard cliphist pipewire wireplumber pavucontrol
brightnessctl playerctl power-profiles-daemon
@@ -86,7 +86,7 @@ fedora)
grim slurp wf-recorder firefox flatpak xdg-desktop-portal-wlr
jq curl unzip git fontconfig gcc rustup) ;;
debian)
- PKGS=(swayfx waybar swaybg swayidle autotiling policykit-1-gnome gnome-keyring
+ PKGS=(swayfx waybar swaybg mpvpaper swayidle autotiling policykit-1-gnome gnome-keyring
mako-notifier libnotify-bin fuzzel gtklock imagemagick kitty yazi
wl-clipboard cliphist pipewire pipewire-pulse wireplumber pavucontrol
brightnessctl playerctl power-profiles-daemon
@@ -94,7 +94,7 @@ debian)
grim slurp wf-recorder firefox flatpak xdg-desktop-portal-wlr
jq curl unzip git fontconfig build-essential rustup) ;;
suse)
- PKGS=(swayfx waybar swaybg swayidle autotiling polkit-gnome gnome-keyring
+ PKGS=(swayfx waybar swaybg mpvpaper swayidle autotiling polkit-gnome gnome-keyring
mako libnotify-tools fuzzel gtklock ImageMagick kitty yazi
wl-clipboard cliphist pipewire wireplumber pavucontrol
brightnessctl playerctl power-profiles-daemon
diff --git a/sway/background.webm b/sway/background.webm
new file mode 100644
index 0000000..5e57a01
Binary files /dev/null and b/sway/background.webm differ
diff --git a/sway/config b/sway/config
index ff4d903..88064fb 100644
--- a/sway/config
+++ b/sway/config
@@ -23,6 +23,7 @@ set $clipwipe cliphist wipe
### Startup
#
exec waybar
+exec ~/.local/bin/wallpaper restore
exec mako
exec --no-startup-id autotiling
diff --git a/waybar/config.jsonc b/waybar/config.jsonc
index 23941e7..7c86d25 100644
--- a/waybar/config.jsonc
+++ b/waybar/config.jsonc
@@ -21,9 +21,11 @@
},
"custom/decor": {
- "format": "<span color='#E0485C'></span>",
- "rotate": 90,
- "tooltip": false
+ "exec": "~/.local/bin/wallpaper status",
+ "return-type": "json",
+ "interval": "once",
+ "signal": 9,
+ "on-click": "~/.local/bin/wallpaper toggle"
},
"sway/workspaces": {
diff --git a/waybar/style.css b/waybar/style.css
index b86a8ed..6327efd 100644
--- a/waybar/style.css
+++ b/waybar/style.css
@@ -72,11 +72,14 @@ tooltip {
padding: 0 14px 0 12px;
}
+/* Wallpaper toggle: crimson picture = still, cyan play = animated */
#custom-decor {
- font-size: 14px;
- padding: 0 10px;
+ font-size: 15px;
+ padding: 0 11px;
border-color: alpha(@crimson, 0.55);
}
+#custom-decor.animated { border-color: alpha(@glow, 0.55); }
+#custom-decor:hover { background: alpha(@surface2, 0.95); }
#workspaces { padding: 0 4px; }