hyprwm / xdg-desktop-portal-hyprland

xdg-desktop-portal backend for Hyprland
BSD 3-Clause "New" or "Revised" License
307 stars 49 forks source link

Not always start on boot #104

Closed coffebar closed 4 months ago

coffebar commented 1 year ago

This kinda workflow is "working" for me from one to another system update for like last month or two. And it is very annoying. Need help to localize this bug or work around it. Please advise where to start.

How I reboot my computer:

  1. systemctl reboot

  2. shutdown correctly

  3. boot into Hyprland ( config ) This script starts from exec-once:

    #!/bin/bash
    sleep 1
    killall -e xdg-desktop-portal-hyprland
    killall -e xdg-desktop-portal-wlr
    killall xdg-desktop-portal
    /usr/lib/xdg-desktop-portal-hyprland &
    sleep 2
    /usr/lib/xdg-desktop-portal &

    Desktop portal is not started (gtk apps long load, firefox crashes, volume indicator missing)

  4. exit hyprland - computer hung, black screen, cooler is working hard

  5. wait for 10 minutes, and do a hard shutdown by holding the Power key.

  6. boot into Hyprland and everything works, desktop portal is working.

Sometimes it takes 2-3 reboots.

coffebar commented 1 year ago

It was 10 minutes earlier, then I rebooted several times in a row and it does not reproduce now. Please don't close, the problem is relevant anyways

thejch commented 1 year ago

Have you tried logging the output /usr/lib/xdg-desktop-portal-hyprland &> logfile

Fuchskaute commented 1 year ago

That scripts looks like it was taken straight from the Gentoo Wiki. Using a script like that to start xdph/other desktop-portals isn't always necessary on systemd to my knowledge, they should automatically be started as part of your dbus user session. Are you starting Hyprland with dbus-run-session too? In which case you do not need that either.

I do not have any such scripts in my hyprland config and systemctl --user status xdg-desktop-portal (or any specific portal) gives me a positive output and it works just fine.

I'm curious if removing that exec-once script and properly launching Hyprland will resolve your issues.

coffebar commented 1 year ago

@Fuchskaute The script was taken straight from hyprland wiki Tested without it and it did not work. The script is required for me, or need to do some more configuration.

I believe the described problem is related to the timing of this script. Sleep 1-2 seems not reliable values.

pacman -Q | awk '{print $1}' | grep '^xdg-'

xdg-dbus-proxy
xdg-desktop-portal
xdg-desktop-portal-hyprland-git
xdg-user-dirs
xdg-utils

is it the correct set of programs?

@thejch Unfortunately, logging gives nothing - empty log Only this thing spamming from xdg-desktop-portal every time (/usr/lib/xdg-desktop-portal:3025): xdg-desktop-portal-WARNING **: 11:08:56.042: No skeleton to export

Fuchskaute commented 1 year ago

I apologize in that case, that seems rather interesting..

kaii-lb commented 1 year ago

same issue here, and now flatpak apps all report (com.github.tchx84.Flatseal:2): Gdk-WARNING **: 18:07:55.873: Failed to read portal settings: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop

which is annoying as hell (i use left aligned window controls)

NgoHuy commented 1 year ago

I have same issue, but no working, it related to #114 , xdgh crashed image

jones-sam commented 11 months ago

I know this isn't a "real" solution, but I fixed this issue (at least for now) just by switching from xdg-desktop-portal-hyprland-git to xdg-desktop-portal-hyprland

coffebar commented 11 months ago

I know this isn't a "real" solution, but I fixed this issue (at least for now) just by switching from xdg-desktop-portal-hyprland-git to xdg-desktop-portal-hyprland

You know, it will work till next update of the xdg-desktop-portal-hyprland

BrayanLope5 commented 6 months ago

Having the same issue and I am on xdg-desktop-portal-hyprland, not xdg-desktop-portal-hyprland-git.

EDIT: Nervermind, adding this line to my hyprland config fixed it. exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP

Nambers commented 5 months ago

Unfortunately, logging gives nothing - empty log Only this thing spamming from xdg-desktop-portal every time (/usr/lib/xdg-desktop-portal:3025): xdg-desktop-portal-WARNING **: 11:08:56.042: No skeleton to export

I also had this issue versions(I also tried xdg-desktop-portal-hyprland-git):

> pacman -Q xdg-desktop-portal
xdg-desktop-portal 1.18.4-1
> pacman -Q xdg-desktop-portal-hyprland
xdg-desktop-portal-hyprland 1.3.1-6

And I do have exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP in my hyprland.conf. This happened when I try to manually run xdg-desktop-portal-hyprland and xdg-desktop-portal(which didn't automatically start at boot and I'm not sure what are their normal behaviors). I'm concern about these are the reason for my OBS said info: [pipewire] No captures available.

UPDATE: it just works after I added the script in https://wiki.hyprland.org/Useful-Utilities/xdg-desktop-portal-hyprland/#usage into exec-once (I was thought that is optional). However, my xdg-desktop-portal-hyprland still show inactived(dead) and complaint about [CRITICAL] Couldn't create the dbus connection ([org.freedesktop.DBus.Error.FileExists] Failed to request bus name (File exists)) but xdg-desktop-portal works.

thyeun commented 4 months ago

I still getting inactive status, as can see from the below image. It is consider normal?

240729_17h50m24s_screenshot

Nambers commented 4 months ago

I still getting inactive status, as can see from the below image. It is consider normal?

In my case, rn xdg-desktop-portal-hyprland is inactive but I had xdg-desktop-portal-gtk active. idk if this behavior normal but OBS screen recording works. And when I uninstall xdg-desktop-portal-gtk, xdg-desktop-protal will throw xdg-desktop-por[24192]: No skeleton to export