XDG Autostart doesn't work / DBUS_SESSION

Moderator: BarryK

Post Reply
Caramel
Posts: 320
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 78 times
Been thanked: 51 times

XDG Autostart doesn't work / DBUS_SESSION

Post by Caramel »

I try to test the flatpak Fcitx (https://flathub.org/apps/org.fcitx.Fcitx5)

The instructions for Fcitx (https://fcitx-im.org/wiki/Setup_Fcitx_5) are the addition of environment variables to a config file (See section Environment variables on https://fcitx-im.org/wiki/Setup_Fcitx_5 ),

and the use of XDG Autostart

XDG Autostart

Certain distribution may not provide such a file. If not, you can simply copy /usr/share/applications/org.fcitx.Fcitx5.desktop to ~/.config/autostart

mkdir -p ~/.config/autostart && cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart

It seems autostart not work in EasyOS (though /etc/xdg/autostart exists).

First question : what are the differences between to use /root/Startup and to use autostart (besides the use of .desktop files with autostart) ?

User avatar
BarryK
Posts: 2273
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 93 times
Been thanked: 564 times

Re: Technical questions : XDG Autostart / DBUS_SESSION

Post by BarryK »

Yes, Easy ignores /etc/xdg/autostart and ~/.config/autostart

You would have to get the content from the "Exec=" line in the .desktop file, and create a script in /root/Startup

Caramel
Posts: 320
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 78 times
Been thanked: 51 times

Re: Technical questions : XDG Autostart / DBUS_SESSION

Post by Caramel »

Thank for the answer.

Apparently Fcitx needs DBus to work.
I am lost, i thought that there was a connection between autostart and dbus.

How to start Fcitx with dbus ?

User avatar
BarryK
Posts: 2273
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 93 times
Been thanked: 564 times

Re: Technical questions : XDG Autostart / DBUS_SESSION

Post by BarryK »

If you installed with Flapi, then dbus is automatically setup.

If the name of the executable is 'fcitx', then there will be script /usr/bin/fcitx.bin created, and you will see in that script how dbus daemon is launched for fcitx to access.

You can start in a terminal to see any errors (without the .bin):

Code: Select all

# fcitx

...it will run as user "fcitx".

If you want to run it as the root user:

Code: Select all

# fcitx.bin
Caramel
Posts: 320
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 78 times
Been thanked: 51 times

Re: Technical questions : XDG Autostart / DBUS_SESSION

Post by Caramel »

Note que Fcitx is not a desktop application with a window. It's a "daemon" (run in background) able to switch keyboard layouts (after use of a keyboard shortcut) (and also to help to type non-western alphabets)

It not opens a window but there is normally a icon in the tray (this icon provides a menu to open the configuration tool (or directly the configuration file if the tool not works), restart, exit...)

BarryK wrote: Wed Jun 14, 2023 11:35 am

You can start in a terminal to see any errors (without the .bin):

Code: Select all

# fcitx

...it will run as user "fcitx".

If you want to run it as the root user:

Code: Select all

# fcitx.bin

Fcitx starts but there is no icon in the tray
No visible error in the terminal :

localuser:fcitx being added to access control list
I2023-06-14 15:39:30.882224 instance.cpp:1252] Override Enabled Addons: {}
I2023-06-14 15:39:30.882577 instance.cpp:1253] Override Disabled Addons: {}
I2023-06-14 15:39:30.890252 addonmanager.cpp:191] Loaded addon imselector
I2023-06-14 15:39:30.907055 addonmanager.cpp:191] Loaded addon xcb
I2023-06-14 15:39:30.918409 addonmanager.cpp:191] Loaded addon quickphrase
I2023-06-14 15:39:30.963574 addonmanager.cpp:191] Loaded addon keyboard
I2023-06-14 15:39:30.981629 addonmanager.cpp:191] Loaded addon dbus
I2023-06-14 15:39:30.989687 addonmanager.cpp:191] Loaded addon dbusfrontend
I2023-06-14 15:39:31.150240 addonmanager.cpp:191] Loaded addon fcitx4frontend
I2023-06-14 15:39:31.223538 addonmanager.cpp:191] Loaded addon ibusfrontend
E2023-06-14 15:39:31.227079 xim.cpp:135] Failed to open xim, retrying.
E2023-06-14 15:39:32.228856 xim.cpp:135] Failed to open xim, retrying.
E2023-06-14 15:39:33.229427 xim.cpp:135] Failed to open xim, retrying.
I2023-06-14 15:39:34.229703 addonmanager.cpp:191] Loaded addon xim
E2023-06-14 15:39:34.241237 waylandmodule.cpp:243] Failed to open wayland connection
I2023-06-14 15:39:34.242039 addonmanager.cpp:191] Loaded addon wayland
I2023-06-14 15:39:34.256439 addonmanager.cpp:191] Loaded addon clipboard
I2023-06-14 15:39:34.259606 addonmanager.cpp:191] Loaded addon waylandim
I2023-06-14 15:39:34.260883 addonmanager.cpp:191] Loaded addon unicode
I2023-06-14 15:39:34.502180 inputmethodmanager.cpp:198] Found 723 input method(s) in addon keyboard
I2023-06-14 15:39:34.622261 addonmanager.cpp:191] Loaded addon kimpanel
I2023-06-14 15:39:34.764342 addonmanager.cpp:191] Loaded addon classicui
I2023-06-14 15:39:34.768775 notificationitem.cpp:41] Running inside flatpak.
I2023-06-14 15:39:34.772596 addonmanager.cpp:191] Loaded addon notificationitem
I2023-06-14 15:39:34.797509 addonmanager.cpp:191] Loaded addon notifications
I2023-06-14 15:39:34.798162 kimpanel.cpp:112] Kimpanel new owner:

Then you need to kill fcitx to use the terminal.

With fcitx.bin, only the beginning is different:

Note that the directory

'/root/.local/share/flatpak/exports/share'

is not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.

I tried again after adding '/root/.local/share/flatpak/exports/share' in the export line but still no success

The app fcitx5 go with other programs : fcitx5-config-tool, fcitx5-remote and in partculiar fcitx5-diagnose to help to solve problems.
These programms are installed by Flapi in /mnt/wkg/flatpak/app/org.fcitx.Fcitx5/current/active/files/bin

How to correctly execute them (in particuliar the script fcitx5-diagnose) ?

(If we type /mnt/wkg/flatpak/app/org.fcitx.Fcitx5/current/active/files/bin/fcitx5-diagnose the script do not find the executable fcitx5 that is located in the same folder)

User avatar
BarryK
Posts: 2273
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 93 times
Been thanked: 564 times

Re: XDG Autostart doesn't work / DBUS_SESSION

Post by BarryK »

What about .desktop files in /mnt/wkg/flatpak/exports/share/applications?
You should be able to click on a .desktop file to run it.

Hmmm, but that probably only does what you already tried. No, not exactly. Looking in my kdenlive .desktop:

Code: Select all

Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=kdenlive --file-forwarding org.kde.kdenlive @@ %F @@

...but can't see anything there that will make any difference.

Caramel
Posts: 320
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 78 times
Been thanked: 51 times

Re: XDG Autostart doesn't work / DBUS_SESSION

Post by Caramel »

BarryK wrote: Thu Jun 15, 2023 12:18 am

What about .desktop files in /mnt/wkg/flatpak/exports/share/applications?
You should be able to click on a .desktop file to run it.

Hmmm, but that probably only does what you already tried. No, not exactly. Looking in my kdenlive .desktop:

Code: Select all

Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=kdenlive --file-forwarding org.kde.kdenlive @@ %F @@

...but can't see anything there that will make any difference.

In org.fcitx.Fcitx5.desktop the exec line is

Code: Select all

/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=/app/bin/fcitx5 org.fcitx.Fcitx5

Clicking on the .desktop or typing the command in terminal does no change anything

Note 1 : When fcitx is launched at boot (via /root/Startup) there are still no fcitx icon in the tray but a empty space is created (between speaker and calendar osmo) in the tray.

Note 2 : I have found the solution to launch fcitx5-diagnose (https://github.com/fcitx/fcitx5/discussions/288), it's like launching the flatpak but we add --command=fcitx5-diagnose to the flatpak command :

Code: Select all

flatpak run --env=GDK_DPI_SCALE=1.1 --env=QT_SCALE_FACTOR=1.1 --filesystem=host --socket=system-bus --socket=cups --socket=ssh-auth --socket=session-bus --command=fcitx5-diagnose org.fcitx.Fcitx5 

This time the executable fcitx5 is found by the script but this last declare fcitx5 is not running (and it's wrong!)

The further I go, the more questions I have.

So i will pause.

Caramel
Posts: 320
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 78 times
Been thanked: 51 times

Small bug?

Post by Caramel »

Probably unimportant,

There is no immodules cache for gtk 3 ( the file /etc/gtk-3.0/gtk.immodules don't exist)

Note : I have created it for the test of fcitx

Code: Select all

gtk-query-immodules-3.0 > /etc/gtk-3.0/gtk.immodules

No improvement

Post Reply

Return to “EasyOS”