aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/WallustSwww.sh
diff options
context:
space:
mode:
authorDon Williams <don.e.williams@gmail.com>2026-01-08 21:31:11 -0500
committerDon Williams <don.e.williams@gmail.com>2026-01-08 21:31:11 -0500
commitc65f9fe0412dafdadee17ee3dc7c42285dcc3753 (patch)
treeafa14ef290ec9ffeec2b3b0a30b06ce081445f81 /config/hypr/scripts/WallustSwww.sh
parent3a423138021325a6d97ab0538625305795a6b1c1 (diff)
Fixing more scripts for Hyprland-Dots
- `WallustSwww.sh` now reads the focused monitor’s cache file (or parses swww query per-monitor) to pick the correct wallpaper path - Eliminating the previous “last line wins” bug on multi-monitor setups. - `PortalHyprland.sh` suppresses harmless killall errors and launches only the first available portal binary in each category (hyprland + general) - Avoiding duplicate processes when both `/usr/lib` and `/usr/libexec` variants exist. - `KillActiveProcess.sh` checks that Hyprland returned a numeric PID before calling kill - Notifies the user when no active window is available instead of throwing kill usage errors. On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: CHANGELOG.md modified: config/hypr/scripts/KillActiveProcess.sh modified: config/hypr/scripts/PortalHyprland.sh modified: config/hypr/scripts/WallustSwww.sh
Diffstat (limited to 'config/hypr/scripts/WallustSwww.sh')
-rwxr-xr-xconfig/hypr/scripts/WallustSwww.sh29
1 files changed, 26 insertions, 3 deletions
diff --git a/config/hypr/scripts/WallustSwww.sh b/config/hypr/scripts/WallustSwww.sh
index d1e53400..50c85630 100755
--- a/config/hypr/scripts/WallustSwww.sh
+++ b/config/hypr/scripts/WallustSwww.sh
@@ -10,6 +10,27 @@ passed_path="${1:-}"
cache_dir="$HOME/.cache/swww/"
rofi_link="$HOME/.config/rofi/.current_wallpaper"
wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current"
+read_cached_wallpaper() {
+ local cache_file="$1"
+ if [[ -f "$cache_file" ]]; then
+ awk 'NF && $0 !~ /^filter/ {print; exit}' "$cache_file"
+ fi
+}
+
+read_wallpaper_from_query() {
+ local monitor="$1"
+ swww query | awk -v mon="$monitor" '
+ /^Monitor/ {
+ cur=$2
+ gsub(":", "", cur)
+ }
+ /image:/ && cur==mon {
+ sub(/^.*image: /,"")
+ print
+ exit
+ }
+ '
+}
# Helper: get focused monitor name (prefer JSON)
get_focused_monitor() {
@@ -39,9 +60,11 @@ else
if [[ -f "$cache_file" ]]; then
# The first non-filter line is the original wallpaper path
- # wallpaper_path="$(grep -v 'Lanczos3' "$cache_file" | head -n 1)"
- # wallpaper_path=$(swww query | grep $current_monitor | awk '{print $9}')
- wallpaper_path=$(swww query | sed 's/.*image: //')
+ wallpaper_path="$(read_cached_wallpaper "$cache_file")"
+ fi
+
+ if [[ -z "$wallpaper_path" ]]; then
+ wallpaper_path="$(read_wallpaper_from_query "$current_monitor")"
fi
fi
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage