dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

[BUG] systemctl service for hyprland fails to start

Open wjarka opened this issue 8 months ago • 2 comments

Describe the bug

It seems like the xdg.sh script is set up in a way that the user service for xdg-desktop-portal-hyprland always fails to start.

Mainly because of:

  • starting /usr/lib/xdg-desktop-portal-hyprland And then running systemctl --user start xdg-desktop-portal-hyprland

Most likely it doesn't actually break anything other than when you call systemctl status xdg-desktop-portal-hyprland it will report it failed to start (because the process is already running)

Here is the error message I found in journalctl:

May 29 10:29:14 work xdg-desktop-portal-hyprland[14153]: [CRITICAL] Couldn't create the dbus connection ([org.freedesktop.DBus.Error.FileExists] Failed to request bus name (File exists))

Steps to reproduce

  1. Start the system
  2. Login to Hyprland (uwsm in my case)
  3. Execute systemctl --user status xdg-desktop-portal-hyprland in the terminal

Expected behavior

Service is active and running

Screenshots

No response

Distribution

Arch Linux

If Other, specify

No response

Additional context

No response

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

wjarka avatar May 29 '25 08:05 wjarka

This is not a dotfiles issue, I guess. Can you make sure that all your packages are updated? Maybe you need to open an issue on the xdg-desktop-portal-hyprland Github page.

mylinuxforwork avatar May 29 '25 15:05 mylinuxforwork

I had the same issue which was causing my screen share from a Chromium browser (Teams) to not work consistently. Commenting out the calls to /usr/lib/xdg-desktop-portal-hyprland and the other portal bins in xdg.sh made it work after a logout. Seems consistent after a couple reboots.

kcooper98 avatar May 30 '25 21:05 kcooper98

I had the same issue which was causing my screen share from a Chromium browser (Teams) to not work consistently. Commenting out the calls to /usr/lib/xdg-desktop-portal-hyprland and the other portal bins in xdg.sh made it work after a logout. Seems consistent after a couple reboots.

Can you share your running xdg.sh?

mylinuxforwork avatar Jun 05 '25 19:06 mylinuxforwork

#!/bin/bash
# __  ______   ____
# \ \/ /  _ \ / ___|
#  \  /| | | | |  _
#  /  \| |_| | |_| |
# /_/\_\____/ \____|
#

# Setup Timers
_sleep1="0.1"
_sleep2="0.5"
_sleep3="2"

# Kill all possible running xdg-desktop-portals
killall -e xdg-desktop-portal-hyprland
killall -e xdg-desktop-portal-gnome
killall -e xdg-desktop-portal-kde
killall -e xdg-desktop-portal-lxqt
killall -e xdg-desktop-portal-wlr
killall -e xdg-desktop-portal-gtk
killall -e xdg-desktop-portal

# Set required environment variables
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=hyprland

# Stop all services
systemctl --user stop pipewire
systemctl --user stop wireplumber
systemctl --user stop xdg-desktop-portal
systemctl --user stop xdg-desktop-portal-gnome
systemctl --user stop xdg-desktop-portal-kde
systemctl --user stop xdg-desktop-portal-wlr
systemctl --user stop xdg-desktop-portal-hyprland
sleep $_sleep1

# Start xdg-desktop-portal-hyprland
#/usr/lib/xdg-desktop-portal-hyprland &
#sleep $_sleep1

# 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
#/usr/lib/xdg-desktop-portal &
#sleep $_sleep2

# Start required services
systemctl --user start pipewire
systemctl --user start wireplumber
systemctl --user start xdg-desktop-portal
systemctl --user start xdg-desktop-portal-hyprland

# Run waybar
sleep $_sleep3
~/.config/waybar/launch.sh

I still have an issue with sharing a kitty terminal. Not sure why because firefox, VS Code, and full screen share work after changing the script ^. Maybe some underlying issue with xdph. Googling around and it seems to have constant problems unrelated to ML4W.

kcooper98 avatar Jun 07 '25 23:06 kcooper98

Following up, looks like screen share works flawlessly with/without the changes above on a second monitor. My main one is new/OLED, so maybe something there is causing screen share issues unrelated to ML4W. Sorry to obfuscate!

kcooper98 avatar Jun 17 '25 22:06 kcooper98

Thanks for testing.

mylinuxforwork avatar Jun 18 '25 19:06 mylinuxforwork