You are not logged in.

#1 2023-09-20 06:26:21

ArchArael
Member
Registered: 2005-06-14
Posts: 504

[SOLVED] EXWM and xdg-desktop-portal, slow application start

I am using EXWM and I have the following two xdg-desktop-* packages installed:

- xdg-desktop-portal
- xdg-desktop-portal-gtk

All of my applications take more that 20 seconds to start the first time.

I have tried to set the XDG_CURRENT_DESKTOP variable accordingly:

export XDG_CURRENT_DESKTOP=exwm

But this did not help.

My guess is that this a xdg-desktop-portal, but I have no idea how to set up this properly. I tried to search online but I could not find anything about how to do it for EXWM.

Any hints?


SOLVED: The dbus-launch calls in the script referenced in the .xinitrc file were the reason of the delay.

Last edited by ArchArael (2023-09-20 08:05:38)

Offline

#2 2023-09-20 07:28:37

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,654

Re: [SOLVED] EXWM and xdg-desktop-portal, slow application start

Make sure you don't have xdg-desktop-portal-gnome, assuming you're using startx/xinit that your session isn't degraded (last link below and what to include there at least) and in doubt post the system journal at least covering the timeframe of the delayed start.

Offline

#3 2023-09-20 07:55:13

ArchArael
Member
Registered: 2005-06-14
Posts: 504

Re: [SOLVED] EXWM and xdg-desktop-portal, slow application start

Thank you for your suggestions.

I do not have the xdg-desktop-portal-gnome and I think that my .xinitrc is probably fine. It is only one line long.

Here is the content of my .xinitrc

exec /home/arael/.emacs.d/exwm/start

Here is the content of the 'start' script:

#!/bin/sh

# Run the screen compositor
picom &

# Enable screen locking on suspend
xss-lock -- slock &
# start dbus daemon
dbus-daemon -d
# start fctix5
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
dbus-launch fcitx5 &
# Fire it up
dbus-launch --exit-with-session emacs --daemon --debug-init -l ~/.emacs.d/desktop.el
exec emacsclient -c

Last edited by ArchArael (2023-09-20 07:58:45)

Offline

#4 2023-09-20 07:58:43

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,654

Re: [SOLVED] EXWM and xdg-desktop-portal, slow application start

Ok, that's horrible tongue

See the last link below, include the system wide scripts and lose all dbus-launch references.

Then see whether you original problem is gone.

Offline

#5 2023-09-20 08:04:00

ArchArael
Member
Registered: 2005-06-14
Posts: 504

Re: [SOLVED] EXWM and xdg-desktop-portal, slow application start

You were right. I have removed the dbus-launch from the script and now it works properly.

Thank you very much.

Offline

#6 2023-09-20 08:06:01

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,654

Re: [SOLVED] EXWM and xdg-desktop-portal, slow application start

The wiki wrote:

Note: At the very least, ensure that the last if block in /etc/X11/xinit/xinitrc is present in your ~/.xinitrc file to ensure that the scripts in /etc/X11/xinit/xinitrc.d are sourced.

This is required to properly tie the xinit session into logind and the session-bus, the relevant stuff is in /etc/X11/xinit/xinitrc.d/50-systemd-user.sh

Offline

#7 2023-09-20 08:21:24

ArchArael
Member
Registered: 2005-06-14
Posts: 504

Re: [SOLVED] EXWM and xdg-desktop-portal, slow application start

Here is my .xinitrc

# Mandatory block for proper initialization
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

# start EXWM
exec /home/arael/.emacs.d/exwm/start

For the start script, I had to use dbus-launch for fcitx5, otherwise it does not connect to the dbus. But the applications start properly, so I guess launching Emacs with dbus-launch was causing the trouble. Do you have any suggestion on how to start the fcitx5 without dbus-launch?

#!/bin/sh
# Run the screen compositor
picom &

# Enable screen locking on suspend
xss-lock -- slock &
# start fctix5
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
fcitx5 &
# Fire it up
emacs --daemon --debug-init -l ~/.emacs.d/desktop.el
exec emacsclient -c

Last edited by ArchArael (2023-09-20 12:00:41)

Offline

#8 2023-09-20 11:09:47

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,654

Re: [SOLVED] EXWM and xdg-desktop-portal, slow application start

The primary question would by *why* it doesn't start properly (notably after importing the session bus).
Can you run it w/o dbus-launch from within the session?
Does it yell errors when started in the exwm start script?

…
fcitx5 > /tmp/fcitx5.out 2>&1 &
…

Offline

#9 2023-09-20 12:00:17

ArchArael
Member
Registered: 2005-06-14
Posts: 504

Re: [SOLVED] EXWM and xdg-desktop-portal, slow application start

After starting with a clean session it actually works. Thank you for your help!

Offline

Board footer

Powered by FluxBB