diff --git a/dotfiles/.config/hypr/scripts/xdg.sh b/dotfiles/.config/hypr/scripts/xdg.sh old mode 100755 new mode 100644 index a52e93c95..549f0943d --- a/dotfiles/.config/hypr/scripts/xdg.sh +++ b/dotfiles/.config/hypr/scripts/xdg.sh @@ -1,7 +1,7 @@ #!/bin/bash -# __ ______ ____ -# \ \/ / _ \ / ___| -# \ /| | | | | _ +# __ ______ ____ +# \ \/ / _ \/ ___| +# \ /| | | | | _ # / \| |_| | |_| | # /_/\_\____/ \____| # @@ -10,11 +10,8 @@ _sleep1="0.1" _sleep2="0.5" _sleep3="2" -_sleep4="1" -sleep $_sleep4 - -# Kill all possible running xdg-desktop-portals +# Kill all running xdg-desktop-portals killall -e xdg-desktop-portal-hyprland killall -e xdg-desktop-portal-gnome killall -e xdg-desktop-portal-kde @@ -26,7 +23,7 @@ killall -e xdg-desktop-portal # Set required environment variables dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=hyprland -# Stop all services +# Stop all services (optional, but good practice) systemctl --user stop pipewire systemctl --user stop wireplumber systemctl --user stop xdg-desktop-portal @@ -36,17 +33,9 @@ systemctl --user stop xdg-desktop-portal-wlr systemctl --user stop xdg-desktop-portal-hyprland sleep $_sleep1 -# Start xdg-desktop-portal-hyprland +# Start xdg-desktop-portal-hyprland and xdg-desktop-portal /usr/lib/xdg-desktop-portal-hyprland & -sleep $_sleep3 - -# Start xdg-desktop-portal-gtk -if [ -f /usr/lib/xdg-desktop-portal-gtk ]; then - /usr/lib/xdg-desktop-portal-gtk & - sleep $_sleep1 -fi - -# Start xdg-desktop-portal +sleep $_sleep1 /usr/lib/xdg-desktop-portal & sleep $_sleep2 @@ -58,4 +47,4 @@ systemctl --user start xdg-desktop-portal-hyprland # Run waybar sleep $_sleep3 -# ~/.config/waybar/launch.sh +~/.config/waybar/launch.sh diff --git a/setup/setup-fedora.sh b/setup/setup-fedora.sh index e438a5a14..2fc484bdb 100755 --- a/setup/setup-fedora.sh +++ b/setup/setup-fedora.sh @@ -130,9 +130,21 @@ _installPackages "${packages[@]}" # -------------------------------------------------------------- # Hyprland # -------------------------------------------------------------- - _installPackages "${hyprland[@]}" +# -------------------------------------------------------------- +# Fix xdg-desktop-portal conflicts +# -------------------------------------------------------------- +echo ":: Configuring xdg-desktop-portal to use Hyprland as default" +# Create the directory if it doesn't exist +if [ ! -d /etc/xdg/xdg-desktop-portal ]; then + sudo mkdir -p /etc/xdg/xdg-desktop-portal +fi + +# Create the configuration file to prioritize Hyprland +echo "[main]" | sudo tee /etc/xdg/xdg-desktop-portal/hyprland-portal.conf +echo "default=hyprland" | sudo tee -a /etc/xdg/xdg-desktop-portal/hyprland-portal.conf + # -------------------------------------------------------------- # Create .local/bin folder # --------------------------------------------------------------