giantpinkrobots/varia

Cannot run app on chromeOS

andrea-scape opened this issue · 4 comments

the app installs just fine but it does not run. Here is the terminal log:

ascape@penguin:~$ flatpak run io.github.giantpinkrobots.varia
Traceback (most recent call last):
File "/app/share/varia/varia/variamain.py", line 323, in main
if (os.path.exists(GLib.get_user_special_dir(GLib.USER_DIRECTORY_DOWNLOAD))):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 19, in exists
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/app/share/varia/../../bin/varia-py.py", line 36, in
sys.exit(main(VERSION, aria2cexec))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/share/varia/varia/variamain.py", line 328, in main
download_directory = GLib.get_user_special_dir(GLib.USER_DIRECTORY_HOME)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/gi/overrides/init.py", line 31, in getattr
return getattr(self._introspection_module, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/gi/module.py", line 130, in getattr
raise AttributeError("%r object has no attribute %r" % (
AttributeError: 'gi.repository.GLib' object has no attribute 'USER_DIRECTORY_HOME'

I know what's going on here but I had postponed writing a solution for it because I didn't think anyone would encounter it. Basically if Varia can't find your downloads directory, it will try to set the main user directory as the place it will download things into. There is no fallback after the user directory check so it'll crash if that can't be found either.

You could try to create a HOME directory in the Linux terminal using mkhomedir_helper. I have no idea how Chrome OS' Linux environment differs from a standard Linux install though and even if this issue is fixed, more difficult to fix issues may arise later. You should know you're on unsupported territory.

Hey, just thought of something. Can you run "xdg-user-dirs-update" inside of the Linux command line?

Alright, glad it worked. It was just because you didn't have a standard Downloads folder. I will add a function that handles that instead of just letting the app crash.