sonnyp / Junction

Application/browser chooser
https://flathub.org/apps/re.sonny.Junction
GNU General Public License v3.0
458 stars 29 forks source link

Custom desktop files on silverblue #33

Closed Ramblurr closed 2 years ago

Ramblurr commented 2 years ago

I've installed Junction on flatpak on Fedora Silverblue (modified, without gnome).

I have a bunch of custom desktop files in ~/.local/share/applications (firefox profiles, etc). However done of these are picked up by Junction.

Notice in the log below that XDG_DATA_DIRS does not contain $HOME/.local/share/applications

$ flatpak run re.sonny.Junction
F: Can't find a11y bus: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not activate remote peer.

(gjs:3): GLib-GIO-WARNING **: 13:53:00.326: Failed to create file monitor for /var/home/ramblurr/.var/app/re.sonny.Junction/config/glib-2.0/settings/keyfile: Unable to find default local file monitor type
Gjs-Message: 13:53:00.337: JS LOG: datadir: /app/share
Gjs-Message: 13:53:00.337: JS LOG: argv /app/bin/re.sonny.Junction
Gjs-Message: 13:53:00.337: JS LOG: programInvocationName: /app/bin/re.sonny.Junction
Gjs-Message: 13:53:00.337: JS LOG: _: /app/bin/re.sonny.Junction
Gjs-Message: 13:53:00.337: JS LOG: PWD: /var/home/ramblurr
Gjs-Message: 13:53:00.337: JS LOG: XDG_DATA_DIRS /app/share:/usr/share:/usr/share/runtime/share:/run/host/user-share:/run/host/share:/run/host/usr/share:/var/lib/flatpak/exports/share:/var/home/ramblurr/.local/share/flatpak/exports/share
Gjs-Message: 13:53:00.337: JS LOG: PATH /app/bin:/usr/bin
Gjs-Message: 13:53:00.337: JS LOG: FLATPAK_ID re.sonny.Junction
Gjs-Message: 13:53:04.249: JS LOG: open,1,demo
sonnyp commented 2 years ago

However done of these are picked up by Junction.

Are the picked up by other applications / your DE?

Notice in the log below that XDG_DATA_DIRS does not contain $HOME/.local/share/applications

Doesn't look like a problem with Junction then - is it a problem with Silverblue or your modifications? Either way - I can't help.

Not sure what you expect me to solve

Ramblurr commented 2 years ago

Are the picked up by other applications / your DE?

Yes they are, they work fine.

Doesn't look like a problem with Junction then - is it a problem with Silverblue or your modifications? Either way - I can't help.

It seems like a problem related to the flatpak. echo $XDG_DATA_DIRS from my shell shows the proper dirs. But if I flatpak enter <appid> bash any flatpak appplication (including Junction) and check for $XDG_DATA_DIRS, it is not set.

If I attempt to override the var with:

flatpak override --user --env=XDG_DATA_DIRS=/var/home/ramblurr/.local/share:/usr/local/share:/usr/share re.sonny.Junction

then running Junction errors with:

$ flatpak run re.sonny.Junction
F: Can't find a11y bus: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not activate remote peer.

(gjs:3): Gjs-CRITICAL **: 15:21:54.720: JS ERROR: Error: GSettings schema re.sonny.Junction not found
_init@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:551:23
@file:///app/share/re.sonny.Junction/common.js:3:25

(gjs:3): Gjs-CRITICAL **: 15:21:54.720: Module file:///app/bin/re.sonny.Junction threw an exception
sonnyp commented 2 years ago

echo $XDG_DATA_DIRS from my shell shows the proper dirs.

Can you share the output ? And echo $XDG_DATA_HOME

sonnyp commented 2 years ago

On a Fresh Silverblue 35 VM

[sonny@fedora ~]$ echo $XDG_DATA_DIRS
/var/home/sonny/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/
sonnyp commented 2 years ago

Ha - got confused. $XDG_DATA_DIRS shouldn't contain ~/.local/share anyway.

https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html

$XDG_DATA_DIRS defines the preference-ordered set of base directories to search for data files in addition to the $XDG_DATA_HOME base directory. The directories in $XDG_DATA_DIRS should be seperated with a colon ':'.

$XDG_DATA_HOME defines the base directory relative to which user-specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.

sonnyp commented 2 years ago

Everything looks good here on Silverblue 35 and I'm able to use custom desktop files

[sonny@fedora ~]$ cp /usr/share/applications/firefox.desktop ~/.local/share/applications/firefox2.desktop
[sonny@fedora ~]$ update-desktop-database ~/.local/share/applications/
[sonny@fedora ~]$ flatpak run --command=sh re.sonny.Junction

[📦 re.sonny.Junction ~]$ echo $XDG_DATA_HOME
/var/home/sonny/.var/app/re.sonny.Junction/data
[📦 re.sonny.Junction ~]$ ls /var/home/sonny/.var/app/re.sonny.Junction/data/applications/
firefox2.desktop  mimeinfo.cache
[📦 re.sonny.Junction ~]$ ls ~/.local/share/applications/
firefox2.desktop  mimeinfo.cache

[📦 re.sonny.Junction ~]$ exit

[sonny@fedora ~]$ flatpak run re.sonny.Junction https://gnome.org

Screenshot from 2021-12-02 22-09-55

Could it be that your desktop file is named like an other one? The name preceeding .desktop must be unique.

sonnyp commented 2 years ago

Did you solve your problem ?