slgobinath / SafeEyes

Protect your eyes from eye strain using this simple and beautiful, yet extensible break reminder
http://slgobinath.github.io/SafeEyes/
GNU General Public License v3.0
1.45k stars 160 forks source link

Stopped working on hyprland #637

Open fdev31 opened 3 weeks ago

fdev31 commented 3 weeks ago

Using Hyprland with gBar or waybar for a long time, recently safeeyes stopped working with a message asking to install OS icons or so...

deltragon commented 3 weeks ago

Did you have a working trayicon before?

archisman-panigrahi commented 3 weeks ago

Does it work when you install and run snixembed?

https://github.com/slgobinath/SafeEyes/wiki/How-to-install-backend-for-Safe-Eyes-tray-icon#installation-of-snixembed

deltragon commented 3 weeks ago

Waybar does depend on libappindicator, so in theory it should already have an implementation of StatusNotifierItem. (Meaning snixembed shouldn't make a difference.)

fdev31 commented 3 weeks ago

Yes it was working. If I run snixembed I get: error: could not acquire watcher name

archisman-panigrahi commented 3 weeks ago

@fdev31 Is there an OS which has hyperland configured by default so that I can test it?

archisman-panigrahi commented 3 weeks ago

Perhaps related to this https://todo.sr.ht/~steef/snixembed/14

There the solution is to add a delay before running snixembed at startup. Try pkill snixembed;sleep 0.5;snixembed --fork

If you are already running snixembed in a session, try closing and reopening it with pkill snixembed;snixembed --fork

deltragon commented 3 weeks ago

I think the error: could not aquire watcher name means that there is already a service providing the StatusNotifierWatcher name, so snixembed isn't necessary. This might be another instance of https://github.com/slgobinath/SafeEyes/issues/636, where SafeEyes starts before waybar? @fdev31 Are you starting SafeEyes using an autostart script? Does it work if you start it manually?

fdev31 commented 3 weeks ago

Ok, I commented it there by mistake, so I'll copy it here too ^^

Briliant, indeed, if I delay safeyes startup I don't experience the issue...

archisman-panigrahi commented 3 weeks ago

Briliant, indeed, if I delay safeyes startup I don't experience the issue...

@fdev31 I will add it to the wiki page. Can you please tell me more information about how to add a startup application in hyprland and how you added the delay?

Also, can you delete your comment in the other GitHub issue (because it is not relevant there)?

fdev31 commented 3 weeks ago

I'm using the desktop file to start it. Will try to see if setting X-GNOME-Autostart-Delay=10, basically I'm starting those desktop apps using dex:

exec-once = dex -a in hyprland.conf

If the variable isn't working, exec-once = sleep 5; dex -a may work.

archisman-panigrahi commented 2 weeks ago

@fdev31 Can you test if this branch https://github.com/deltragon/SafeEyes/tree/trayicon-retry works for you? In case you are using Arch, try this PKGBUILD

pkgname=safeeyes-git
pkgver=2.2.2
pkgrel=2
pkgdesc="A Free and Open Source tool for Linux users to reduce and prevent repetitive strain injury (RSI). Latest version from the git repository"
arch=("any")
url="https://github.com/deltragon/SafeEyes"
license=("GPL3")
depends=("alsa-utils"
         "hicolor-icon-theme"
         "libappindicator-gtk3"
         "python"
         "python-babel"
         "python-dbus"
         "python-gobject"
         "python-psutil"
         "python-xlib"
         "xorg-xprop")
conflicts=("safeeyes")
makedepends=("python-setuptools" "git")
optdepends=("xprintidle: better idle timer"
            "python-croniter: health stats plugin"
            "swayidle: for smart pause")
source=("git+https://github.com/deltragon/SafeEyes.git#branch=trayicon-retry")
sha1sums=('SKIP')

pkgver() {
    cd "$srcdir/SafeEyes"
    git describe --tags --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

package() {
    cd "$srcdir/SafeEyes"
    PYTHONUSERBASE="/usr" python setup.py install --root="$pkgdir/" --optimize=1
}