Closed antoninkriz closed 1 month ago
@antoninkriz In GNOME you will need this extension https://extensions.gnome.org/extension/615/appindicator-support/
snixembed or other tweaks will not work there.
It seems that in your system, safeeyes is starting before the extension does. The solution is to add a 10 second delay for the safeeyes startup.
Please let us know if that works
Add X-GNOME-Autostart-Delay=10
to the safeeyes desktop file in .config/autostart
.
If it works, we can add the delay to the startup file safeeyes creates, so that no one will experience this bug.
What do you think @deltragon
In GNOME you will need this extension
I have this extension installed (gnome-shell-extension-appindicator
package in Manjaro) and enabled.
It seems that in your system, safeeyes is starting before the extension does. The solution is to add a 10 second delay for the safeeyes startup.
This was right! Good catch! Sadly X-GNOME-Autostart-Delay=10
(not even with X-GNOME-Autostart-enabled=true
as some people suggested in some Reddit / StackOverflow threads) did not work. Some people report it doesn't work for them as well. I tried changing the Exec=...
line so it contains some variant of sleep 10 && ...
but without much success (although without much effort as well :smile:) so I decided to drop in
import time
time.sleep(10)
in the beginning of the sleepeyes executable script and it works, although it's quite ugly.
If needed I would be happy to help with fixing this bug.
While it works for you, I am against adding a sleep timer to the core safeeyes code.
Let's do more research about how to add a timer to the desktop file.
Cinnamon has an inbuilt delay option for startup apps and I don't use GNOME. I will download Ubuntu with GNOME in a VM and check if Cinnamon's solution works there.
I do think that it may make sense to add logic to the Smartpause plugin to try again after a few seconds (maybe even something like retrying first after one second, then after two more, then after 5 more, and then error). In the working scenario, this will not change anything - in the error scenario it will only delay the error a little bit. But it would make this kind of situation less likely to happen. Adding a delay to the startup file will delay it in all cases, even when it would have worked otherwise. (As an aside, it would also be interesting to check how libappindicator handled this situation - did it also have some kind of retry/exponential backoff logic?)
Alternatively, instead of adding the logic to smartpause, if we add the following logic to the system tray plugin, that will also work.
Try to open tray icon
If doesn't work
Wait for 5 seconds
Try again
Now show the missing backend window
Yes, that was a typo from me - I meant the trayicon plugin, not smartpause.
Adding X-GNOME-Autostart-Delay=10
to the desktop file delays the app during system startup in Cinnamon desktop, but does not cause any delay if the app is run manually (just as it should be).
It is sad that it does not work in GNOME
How about we maintain two desktop files, a special one for startup, and one for regular app opening? In the startup desktop file, we add a sleep 5
irrespective of the desktop environment? Then no special logic is necessary within the app, and it would keep things simple.
This might not be viable since startup apps can be added in GNOME through the Tweaks app by selecting an app from a list.
If I'm not mistaken the list is made from the standard .desktop files used for manually opening apps.
When selecting an app to autostart the same .desktop file is just copied over to the autostart folder.
So when someone manually adds SafeEyes to startup apps the delay wouldn't be there.
I might be wrong so take this with a grain of salt.
When selecting an app to autostart the same .desktop file is just copied over to the autostart folder.
SafeEyes automatically copies its desktop file to the $HOME/.config/autostart
folder when you run it for the first time. Can you confirm that adding X-GNOME-Autostart-Delay=10
to that still does not fix the issue?
How about we maintain two desktop files, a special one for startup, and one for regular app opening? In the startup desktop file, we add a
sleep 5
irrespective of the desktop environment? Then no special logic is necessary within the app, and it would keep things simple.
I don't think that's a viable solution - .desktop files are handled by the desktop environment in many places, and I assume none of them are expecting an app to have multiple ones.
I don't think that's a viable solution - .desktop files are handled by the desktop environment in many places, and I assume none of them are expecting an app to have multiple ones.
It's expected that the ~/.config/ overrides the system one, that's how it works as far as I know.
After upgrading my safeeyes I am having the same issue but I am running i3-wm
as my window manager. According to the tray icon backend install page it should work out of the box for i3. Contrary to @antoninkriz for me it also doesn't work if I close the error and try to manually start safeeyes. I always get the error. My debug log:
2024-08-30 16:13:30,597 [DEBUG]:[MainThread] Initialize the platform
2024-08-30 16:13:30,611 [INFO]:[MainThread] Starting Safe Eyes
2024-08-30 16:13:30,614 [INFO]:[MainThread] Starting up Application
2024-08-30 16:13:30,633 [INFO]:[MainThread] Initialize the break screen
2024-08-30 16:13:30,633 [INFO]:[MainThread] Load all the plugins
2024-08-30 16:13:30,633 [INFO]:[MainThread] Initialize the core
2024-08-30 16:13:30,634 [INFO]:[MainThread] Successfully loaded <module 'donotdisturb.plugin' from '/usr/lib/python3.12/site-packages/safeeyes/plugins/donotdisturb/plugin.py'>
2024-08-30 16:13:30,635 [INFO]:[MainThread] Successfully loaded <module 'notification.plugin' from '/usr/lib/python3.12/site-packages/safeeyes/plugins/notification/plugin.py'>
2024-08-30 16:13:30,636 [INFO]:[MainThread] Successfully loaded <module 'audiblealert.plugin' from '/usr/lib/python3.12/site-packages/safeeyes/plugins/audiblealert/plugin.py'>
2024-08-30 16:13:30,638 [INFO]:[MainThread] Show RequiredPlugin dialog
2024-08-30 16:13:30,663 [INFO]:[MainThread] Setting up an RPC server on port 7200
2024-08-30 16:13:30,664 [INFO]:[MainThread] Start the RPC server
2024-08-30 16:13:30,665 [INFO]:[MainThread] Application activated
2024-08-30 16:13:32,466 [INFO]:[MainThread] Quit Safe Eyes
2024-08-30 16:13:32,467 [INFO]:[MainThread] Close the break screen(s)
2024-08-30 16:13:32,467 [INFO]:[MainThread] Unlock the keyboard
2024-08-30 16:13:32,469 [DEBUG]:[MainThread] Stop Notification plugin
2024-08-30 16:13:32,470 [INFO]:[MainThread] Stop the RPC server
System info: OS: Arch Linux i3-wm: 4.23-4 safeeyes: 2.2.2-1 (installed from AUR)
What can I do to further debug this? There do not seem to be any error messages in the debug log.
@ahkole Can you check if installing snixembed from the AUR, and running snixembed --fork
fixes the issue?
Maybe other people who tested it in i3-wm had some backend installed for the tray icon, which you do not have.
Can you check if installing snixembed from the AUR, and running snixembed --fork fixes the issue?
Hi @archisman-panigrahi, this indeed fixes the issue. Was this dependency on a backend added somewhere in the last year? It used to run normally without having snixembed
installed.
Ok. You have to add snixembed --fork
to your startup application for safeeyes to work smoothly.
We recently changed our backend for tray icon as a preparation of our upcoming transition to GTK4. While most full-fledged desktop interfaces support this modern backend, some WMs and DEs don't support it. snixembed
acts as a bridge between the the two technologies.
Some other users reported to us that it works out-of-the box in i3. Maybe some distros have a customized i3 with more background processes to support the new trayicon, but the vanilla i3 in Arch does not support it out-of-the box. I will add it to the wiki.
Alright, good to know. Thanks for helping me fix it. I'll add the call to snixembed
to my startup config. I'll also make note of this in the AUR package for safeeyes.
I am the AUR package maintainer. I can add a comment that some users may need snixembed. I don't want to add it as an optional dependency, because it is not really a dependency of safeeyes, but rather a deficiency of window managers. Full fledged DEs like KDE don't have a problem.
I updated the wiki for information about i3
On Fri, Aug 30, 2024, 12:57 PM Arnold Kole @.***> wrote:
Alright, good to know. Thanks for helping me fix it. I'll add the call to snixembed to my startup config. I'll also make note of this in the AUR package for safeeyes.
— Reply to this email directly, view it on GitHub https://github.com/slgobinath/SafeEyes/issues/636#issuecomment-2321976032, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXL2XA2SRGI7OT4PWOUGPDZUCQAVAVCNFSM6AAAAABMSCRUWCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRRHE3TMMBTGI . You are receiving this because you were mentioned.Message ID: @.***>
Ah okay, sounds good!
Describe the bug
I'm getting the error message as in the title of this issue:
This started happening very recently (few days ago?), possibly due to some update, although I'm not sure. I had
AppIndicator
andKStatusNotifierItem
packages installed and enables as GNOME extension. I tried to reinstall both the Safe Eyes AUR package and these packages without success. Later I installedsnixembed
as another option I found in the How to install backend for Safe Eyes tray icon tutorial, also without success.This error happens only when the app auto starts as an Startup Application, enabled in the GNOME Tweaks app. When I launch the app by clicking the icon in app menu or from terminal everything works correctly and there aren't any problems apparent in the debug log.
This error feels similar to https://github.com/nix-community/home-manager/issues/5728, but I'm not using Nix and with Nix the issue might be somewhere else, possibly really because of missing dependencies. I'm just linking this issue here since it might be interesting.
To Reproduce Steps to reproduce the behavior:
Steps NOT to reproduce the behavior:
Expected behavior Safe Eyes not displaying error and launching correctly
Desktop (please complete the following information):
gnome-shell-extension-appindicator
1:59-1libappindicator-gtk2
12.10.0.r298-4lib32-libappindicator-gtk2
12.10.0.r298-2libappindicator-gtk3
12.10.0.r298-4lib32-libappindicator-gtk3
12.10.0.r298-2libayatana-appindicator
0.5.93-1kstatusnotifieritem
6.4.0-1snixembed
0.3.3-1 (AUR)Debug Log