diff options
| author | Don Williams <don.e.williams@gmail.com> | 2026-01-08 21:31:11 -0500 |
|---|---|---|
| committer | Don Williams <don.e.williams@gmail.com> | 2026-01-08 21:31:11 -0500 |
| commit | c65f9fe0412dafdadee17ee3dc7c42285dcc3753 (patch) | |
| tree | afa14ef290ec9ffeec2b3b0a30b06ce081445f81 /config/hypr/scripts/PortalHyprland.sh | |
| parent | 3a423138021325a6d97ab0538625305795a6b1c1 (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/PortalHyprland.sh')
| -rwxr-xr-x | config/hypr/scripts/PortalHyprland.sh | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/config/hypr/scripts/PortalHyprland.sh b/config/hypr/scripts/PortalHyprland.sh index 21cb7db4..653e9b58 100755 --- a/config/hypr/scripts/PortalHyprland.sh +++ b/config/hypr/scripts/PortalHyprland.sh @@ -2,15 +2,39 @@ # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # For manually starting xdg-desktop-portal-hyprland +set -euo pipefail + +kill_quietly() { + killall -q "$1" 2>/dev/null || true +} + +start_portal_binary() { + local description="$1" + shift + for candidate in "$@"; do + if [[ -x "$candidate" ]]; then + "$candidate" & + return 0 + fi + done + echo "Warning: no $description binary found (checked: $*)" >&2 + return 1 +} + sleep 1 -killall xdg-desktop-portal-hyprland -killall xdg-desktop-portal-wlr -killall xdg-desktop-portal-gnome -killall xdg-desktop-portal +kill_quietly xdg-desktop-portal-hyprland +kill_quietly xdg-desktop-portal-wlr +kill_quietly xdg-desktop-portal-gnome +kill_quietly xdg-desktop-portal sleep 1 -/usr/lib/xdg-desktop-portal-hyprland & -/usr/libexec/xdg-desktop-portal-hyprland & + +start_portal_binary "xdg-desktop-portal-hyprland" \ + /usr/lib/xdg-desktop-portal-hyprland \ + /usr/libexec/xdg-desktop-portal-hyprland + sleep 2 -/usr/lib/xdg-desktop-portal & -/usr/libexec/xdg-desktop-portal & + +start_portal_binary "xdg-desktop-portal" \ + /usr/lib/xdg-desktop-portal \ + /usr/libexec/xdg-desktop-portal |
