mijorus/gearlever

[Bazzite] Silent error when changing AppImage default location

Opened this issue · 6 comments

Recently I've moved to Bazzite (a distro based on Fedora Atomic Desktops) and various things are centralized inside /var, home directory included. When trying to rename Gear Lever's default folder from "AppImages" to "Applications" the interface just didn't react, nothing was changed. After inspecting the output, I've encountered this:

Traceback (most recent call last):
  File "/app/share/gearlever/gearlever/preferences.py", line 124, in on_select_default_location_response
    raise InternalError(_('The folder must be in your home directory'))

Knowing that, I could manage to change the default location to /home/$USER/Applications. The thing is, /var/home/$USER is my home directory and where the file chooser points me to, /home being just a symlink. After analysing the culprit line, it seems to me that GLib.get_home_dir() returns /home/$USER and not /var/home/$USER:

if selected_file.query_exists() and selected_file.get_path().startswith(GLib.get_home_dir()):

Why is that is another thing entirely, but checking for the real path, alongside the current checks, should do the trick.

Potentially unrelated, but how exactly did you access that traceback? Might prove useful in the future!

@MMachado05 It was printed to terminal when I ran flatpak run it.mijorus.gearlever, no extra hoops necessary :)

Ah, I'd never considered running it from the terminal! Definitely helpful. 👍

Hi @GeeLeonidas, that check exists because Gear Lever has write permissions only in the home directory, hence that check.
I will try to investigate more, thank you

@GeeLeonidas I was able to fix this on Bazzite by editing my /etc/passwd file to change the default home directory of my user from /home/<username> to /var/home/<username>. I'm not sure if that'll cause any problems down the line though.

To clarify the OP, you can fix this by manually typing in the path /home/$USER/Applications instead of picking the folder from the file picker (which will end up as /var/home/$USER/Applications)