Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Doesn't want to run on startup (Ubuntu 20.04 LTS - Wayland) #367

Open
smith558 opened this issue Jul 6, 2020 · 18 comments · May be fixed by #561
Open

[Bug] Doesn't want to run on startup (Ubuntu 20.04 LTS - Wayland) #367

smith558 opened this issue Jul 6, 2020 · 18 comments · May be fixed by #561
Assignees

Comments

@smith558
Copy link

smith558 commented Jul 6, 2020

OS - Ubuntu 20.04 LTS
display server - Wayland
app version - 2.0.9-1
source - lp_ppa_slgobinath_safeeyes-focal-main
also tried
source - ppa:slgobinath/safeeyes

Safe Eyes does not run on startup with default startup script settings. Also tried custom settings for usr/bin/safeeyes usr/bin/x11/safeeyes and bin/safeeyes & bin/x11/safeyes

App runs just fine when launched manually.

@smith558 smith558 changed the title Doesn't want to run on startup (Ubuntu 20.04 LTS - Wayland) [Bug] Doesn't want to run on startup (Ubuntu 20.04 LTS - Wayland) Jul 7, 2020
@slgobinath
Copy link
Owner

Does it mean that it doesnt run at startup but works if you start from the terminal? If so, could you pls try this solution: #361 (comment)

If doesn't run at all (even from the terminal), can you try safeeyes --debug from the terminal and share the output?

@smith558
Copy link
Author

smith558 commented Jul 9, 2020

Does it mean that it doesnt run at startup but works if you start from the terminal? If so, could you pls try this solution: #361 (comment)

If doesn't run at all (even from the terminal), can you try safeeyes --debug from the terminal and share the output?

Precisely, doesn't run on startup only, otherwise works fine when launched via the icon in 'all apps' or via the terminal. safeeyes --debug doesn't show any exceptions

@smith558
Copy link
Author

smith558 commented Jul 9, 2020

@slgobinath if i understood it correctly, #361 (comment) states I should just remove ~/.config/autostart/safeeyes.desktop and it will work on startup? thx

if so, #361 (comment) failed

@slgobinath
Copy link
Owner

I saw similar problem commented on https://aur.archlinux.org/packages/safeeyes-git

Can you check if there is a valid entry in /usr/share/applications/safeeyes.desktop? If it is not there, the ~/.config/autostart/safeeyes.desktop is not gonna work.
I think deleting ~/.config/autostart/safeeyes.desktop and manually adding safe eyes to start up should fix this but I will check on my side why this happens.

@slgobinath slgobinath added the bug label Jul 9, 2020
@smith558
Copy link
Author

smith558 commented Jul 9, 2020

safeeyes.desktop in /usr/share/applications

[Desktop Entry]
Name=Safe Eyes
Comment=Protect your eyes from eye strain
Comment[ca]=Protegiu-vos els ulls de la fatiga visual
Comment[cs]=Chraňte své oči před únavou
Comment[de]=Schützt die Augen vor Überanstrengung
Comment[es]=Protege tus ojos de la fatiga ocular
Comment[et]=Kaitse oma silmi väsimuse eest
Comment[fa]=محافظت چشم هااز ضعیف شدن
Comment[fr]=Protégez vos yeux de la fatigue
Comment[ge]=დაიცავით თქვენი თვალები დაღლილობისაგან
Comment[hi]=तनाव से आंखों की रक्षा
Comment[hu]=Protect your eyes from eye strain
Comment[id]=Melindungi mata Anda dari kelelahan
Comment[lt]=Apsaugokite savo akis nuo įtampos
Comment[lv]=Aizsargājiet savas acis no pārslodzes
Comment[mk]=Заштитете се од замор на очите
Comment[pl]=Chroń oczy przed zmęczeniem
Comment[pt]=Proteja seus olhos da tensão ocular
Comment[ru]=Защитите свои глаза от зрительного перенапряжения
Comment[sk]=Chráňte svoje oči pred únavou
Comment[ta]=உங்கள் கண்களை சோர்வடையாது பாதுகாத்திடுங்கள்
Comment[tr]=Gözünüzü yorgunluğa karşı koruyun
Comment[uk]=Захистіть свої очі від втоми
Comment[vi]=Bảo vệ đôi mắt của bạn khỏi sự mệt mỏi
Exec=env GDK_BACKEND=x11 safeeyes
Icon=safeeyes
Terminal=false
Type=Application
Categories=Utility;

@smith558
Copy link
Author

smith558 commented Jul 9, 2020

How exactly should I manually add safe eyes to startup? I tried multiple ways but none turned out to work.

Commands I tried: safeeyes usr/bin/safeeyes usr/bin/x11/safeeyes and bin/safeeyes & bin/x11/safeyes

@slgobinath
Copy link
Owner

Its strange. I will try Ubuntu 20.04 on VM and let you know.

@smith558
Copy link
Author

smith558 commented Jul 9, 2020

I've narrowed down the issue. The startup works fine when running Ubuntu with Xorg (default display server), I am running Ubuntu with Wayland 90% of the time.

The issue basically boils down to https://unix.stackexchange.com/questions/433188/how-do-i-auto-start-x-application-in-wayland

@smith558
Copy link
Author

@slgobinath any progress on this by any chance?

@slgobinath
Copy link
Owner

slgobinath commented Jul 30, 2020

Sorry I forgot to reply here. I wasn't able to get Ubuntu 20.04 installed on Virtual Box. At the end of installation, it freezes forever (tried several times).
I am trying to get this resolved to reproduce the problem. I am little busy for a week. I will get back to you hopefully by August 8/9.

Maybe I should try Fedora.

@slgobinath slgobinath self-assigned this Jul 30, 2020
@slgobinath
Copy link
Owner

Hi, I was able to reproduce the problem. When I logged in with Wayland, I got the error Cannot connect to display server.

I was able to fix it by creating ~/.Xauthority file.

Please execute this command from the terminal, logout and login

touch ~/.Xauthority

Relevant issue: #206

Please let me know if this helps. Thanks

@smith558
Copy link
Author

Hi, I was able to reproduce the problem. When I logged in with Wayland, I got the error Cannot connect to display server.

I was able to fix it by creating ~/.Xauthority file.

Please execute this command from the terminal, logout and login

touch ~/.Xauthority

Relevant issue: #206

Please let me know if this helps. Thanks

@slgobinath had no effect

@rob006
Copy link

rob006 commented Jun 14, 2021

I'm not sure if it helps, but this error is logged in my case:

cze 14 13:42:16 robert-laptop safeeyes.desktop[1459792]: Traceback (most recent call last):
cze 14 13:42:16 robert-laptop safeeyes.desktop[1459792]:   File "/usr/bin/safeeyes", line 9, in <module>
cze 14 13:42:16 robert-laptop safeeyes.desktop[1459792]:     load_entry_point('safeeyes==2.1.3', 'console_scripts', 'safeeyes')()
cze 14 13:42:16 robert-laptop safeeyes.desktop[1459792]:   File "/usr/lib/python3/dist-packages/safeeyes/__main__.py", line 147, in main
cze 14 13:42:16 robert-laptop safeeyes.desktop[1459792]:     safe_eyes = SafeEyes(system_locale, config)
cze 14 13:42:16 robert-laptop safeeyes.desktop[1459792]:   File "/usr/lib/python3/dist-packages/safeeyes/safeeyes.py", line 84, in __init__
cze 14 13:42:16 robert-laptop safeeyes.desktop[1459792]:     self.break_screen = BreakScreen(
cze 14 13:42:16 robert-laptop safeeyes.desktop[1459792]:   File "/usr/lib/python3/dist-packages/safeeyes/ui/break_screen.py", line 47, in __init__
cze 14 13:42:16 robert-laptop safeeyes.desktop[1459792]:     self.display = Display()
cze 14 13:42:16 robert-laptop safeeyes.desktop[1459792]:   File "/usr/lib/python3/dist-packages/Xlib/display.py", line 89, in __init__
cze 14 13:42:16 robert-laptop safeeyes.desktop[1459792]:     self.display = _BaseDisplay(display)
cze 14 13:42:16 robert-laptop safeeyes.desktop[1459792]:   File "/usr/lib/python3/dist-packages/Xlib/display.py", line 71, in __init__
cze 14 13:42:16 robert-laptop safeeyes.desktop[1459792]:     protocol_display.Display.__init__(self, *args, **keys)
cze 14 13:42:16 robert-laptop safeeyes.desktop[1459792]:   File "/usr/lib/python3/dist-packages/Xlib/protocol/display.py", line 167, in __init__
cze 14 13:42:16 robert-laptop safeeyes.desktop[1459792]:     raise error.DisplayConnectionError(self.display_name, r.reason)
cze 14 13:42:16 robert-laptop safeeyes.desktop[1459792]: Xlib.error.DisplayConnectionError: Can't connect to display ":0": b'No protocol specified\n'

@shaform
Copy link

shaform commented Aug 7, 2021

I also encounter the same issue when booting with Wayland on Ubuntu 20.04. Adding ~/.Xauthority doesn't fix it for me, either. The error message I found in the log is the same as the one @rob006 provided.

Also, it seems that at the time of the crash, the $XAUTHORITY environment variable points to /run/user/$UID/.mutter-Xwaylandauth.XXXX, so I guess ~/.Xauthority wouldn't be used.

@shaform
Copy link

shaform commented Aug 7, 2021

I found a simple workaround to prevent the crash. If we add a time.sleep(...) before the following line, it no longer crashes.

self.display = Display()

@archisman-panigrahi
Copy link
Collaborator

Version 2.2.1 runs on startup with Wayland in Arch Linux with KDE 6.1.3. Maybe it did not run properly with Wayland in 2020, but now it appears to be fixed. If you can reproduce this on any recently released operating system, please reopen the issue.

@deltragon
Copy link
Collaborator

I can reproduce this - it only appears when XWayland isn't running (or in the startup case, not running yet, I assume).
With compositors switching to only starting XWayland on demand, and more applications getting ported to wayland, this will happen more often.

@deltragon deltragon reopened this Aug 4, 2024
@deltragon deltragon self-assigned this Aug 4, 2024
@archisman-panigrahi
Copy link
Collaborator

Possible workaround: Start using the desktop file, or start with the command GDK_BACKEND=x11 safeeyes (this is what the desktop file uses). I don't know whether this will automatically start xwayland.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants