diff options
| author | Pinapelz <yukais@pinapelz.com> | 2026-03-30 21:58:55 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-03-30 21:58:55 -0700 |
| commit | 4acf85db722ebe7e019e7427436083b3b9f4959e (patch) | |
| tree | 6d5b416ad605730a6d573d1b4178c7676dc8a015 /config/hypr/scripts/WallpaperCmd.sh | |
| parent | 89e10cd0c0331fc727889d41e34309db1fb5735f (diff) | |
| parent | e4b9059d346e6a6dbd6216cd1fb5e41085bb6e7b (diff) | |
Merge remote-tracking branch 'upstream/main'
Diffstat (limited to 'config/hypr/scripts/WallpaperCmd.sh')
| -rwxr-xr-x | config/hypr/scripts/WallpaperCmd.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/config/hypr/scripts/WallpaperCmd.sh b/config/hypr/scripts/WallpaperCmd.sh new file mode 100755 index 00000000..0191ee14 --- /dev/null +++ b/config/hypr/scripts/WallpaperCmd.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# Wallpaper command selector (awww preferred, swww fallback) + +if command -v awww >/dev/null 2>&1; then + WWW_CMD="awww" + WWW_DAEMON="awww-daemon" + WWW_CACHE_DIR="$HOME/.cache/awww" + WWW_DAEMON_ARGS=() + WWW_MIGRATION_MARKER="$WWW_CACHE_DIR/.cache_cleared" +else + WWW_CMD="swww" + WWW_DAEMON="swww-daemon" + WWW_CACHE_DIR="$HOME/.cache/swww" + WWW_DAEMON_ARGS=(--format xrgb) +fi +# One-time cache clear when migrating from swww to awww +if [ "$WWW_CMD" = "awww" ]; then + mkdir -p "$WWW_CACHE_DIR" + if [ ! -f "$WWW_MIGRATION_MARKER" ]; then + awww clear-cache >/dev/null 2>&1 || true + touch "$WWW_MIGRATION_MARKER" + fi +fi + +export WWW_CMD WWW_DAEMON WWW_CACHE_DIR WWW_DAEMON_ARGS WWW_MIGRATION_MARKER |
