aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/PortalHyprland.sh
diff options
context:
space:
mode:
authorMartin Guzman <55927935+brockar@users.noreply.github.com>2026-01-21 16:18:43 -0300
committerGitHub <noreply@github.com>2026-01-21 16:18:43 -0300
commitc6198c1bedeffd08ec3f60f7ba3a41e6c5870885 (patch)
tree458c030873b4e70ff9eda0baed5df257434871f4 /config/hypr/scripts/PortalHyprland.sh
parent7dedbe3d4a4560ac15987fdf8164dbbb1f4701bf (diff)
parent88a09344e8cc7cffe69a017eb752e8c6fa17ddcb (diff)
Merge pull request #927 from JaKooLit/development
Merge Development to main branch for release
Diffstat (limited to 'config/hypr/scripts/PortalHyprland.sh')
-rwxr-xr-xconfig/hypr/scripts/PortalHyprland.sh40
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
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage