SafeEyes icon indicating copy to clipboard operation
SafeEyes copied to clipboard

Broken old autostart link does never get updated if JSON file is present

Open ilario opened this issue 3 years ago • 1 comments

SafeEyes does not start at startup anymore (so this is a specific case of #367 and #361) when the Python version gets updated and SafeEyes reinstalled. But runs fine every time it gets launched directly. I observed this on Arch Linux installing SafeEyes via Yay + AUR.

To Reproduce Steps to reproduce the behavior:

  1. Install Python3.9
  2. Install SafeEyes
  3. Open SafeEyes
  4. Make sure that a configuration file has been created in .config/safeeyes/safeeyes.json. If this file is not present, launch safeeyes -s and edit random settings.
  5. Upgrade Python3.9 to Python3.10
  6. Remove SafeEyes and reinstall it, so it moves from 3.9 to 3.10 directory
  7. Open SafeEyes

The autostart link ~/.config/autostart/safeeyes.desktop still points to /usr/lib/python3.9/site-packages/safeeyes/platform/safeeyes.desktop

Expected behavior An updated autostart link should be present pointing to /usr/lib/python3.10/site-packages/safeeyes/platform/safeeyes.desktop, allowing SafeEyes to start at every boot.

Analysis utility.create_startup_entry() gets called by utility.initialize_safeeyes() which gets called by model.Config.__init__ ONLY IF __user_config (the JSON file) is not present. So, if the JSON file is not present, the link gets updated. But usually the JSON file is there, so the link does never get updated and remains broken.

Workaround Open the SafeEyes settings with safeeyes -s and click the weird small button which allows you to reset the configuration and will also force the upgrading of the autostart link.

Desktop (please complete the following information):

  • OS: Arch
  • Desktop Env: Gnome 41.3
  • Version 2.1.3

ilario avatar Jan 23 '22 13:01 ilario

If the check was on the presence/absence of the link (instead than the JSON file), this issue can be fixed on Arch AUR side (I suppose) having the removal of the package also removing the link with a pre_remove or post_remove instruction in PKGBUILD or simply having the PKGBUILD create (and remove) the link. The current situation is that the autostart link does not get removed and remains as a broken link.

ilario avatar Jan 23 '22 14:01 ilario

Same problem...

OS: Manjaro (Gnome-wayland) Repo: http://aur.archlinux.org/packages/safeeyes

Any solution?

ghost avatar Jan 14 '23 12:01 ghost

@bambirombi do you still see this issue on your Manjaro installation? Can you test the code in #531 (I already tested it on my Arch)?

ilario avatar Jul 10 '23 10:07 ilario

@ilario Now it appears to be working.

ghost avatar Jul 30 '23 20:07 ghost

Thanks @ilario for your contribution

slgobinath avatar Aug 18 '23 15:08 slgobinath