Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 8 additions & 19 deletions dotfiles/.config/hypr/scripts/xdg.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# __ ______ ____
# \ \/ / _ \ / ___|
# \ /| | | | | _
# __ ______ ____
# \ \/ / _ \/ ___|
# \ /| | | | | _
# / \| |_| | |_| |
# /_/\_\____/ \____|
#
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand All @@ -58,4 +47,4 @@ systemctl --user start xdg-desktop-portal-hyprland

# Run waybar
sleep $_sleep3
# ~/.config/waybar/launch.sh
~/.config/waybar/launch.sh
14 changes: 13 additions & 1 deletion setup/setup-fedora.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
# --------------------------------------------------------------
Expand Down