elkowar / eww

ElKowars wacky widgets
https://elkowar.github.io/eww
MIT License
8.8k stars 364 forks source link

[BUG] Systray updates #1065

Open keiko37 opened 3 months ago

keiko37 commented 3 months ago

Checklist before submitting an issue

Description of the bug

Added the systray widget inside the my systembar but it doesn't want to work properly.

Reproducing the issue

Install eww from last master branch. Code below is a simple bar(I commented some unnecessary lines of code).

My setup(if you need anything else let me know):

Expected behaviour

Just common behavior as in other bars. I checked in pair with polybar and it's working instead of eww's systray. It doesn't launch on every tries. Also it doesn't restore list of applications after reloading wm.

Additional context

Part of my systembar.

(include "./systembar/modules/systray/config.yuck")

(defwindow
  systembar
  :monitor 0
  :geometry (
    geometry
    :x "0%"
    :y "-8px"
    :width "98%"
    :height "40px"
    :anchor "bottom center"
  )
  :hexpand false
  :vexpand false
  :stacking "fg"
  :reserve (struts :distance "48px" :side "bottom")
  :windowtype "dock"
  :wm-ignore false
  (systembar)
)

(defwidget systembar []
  (centerbox
  :class "systembar-wrapper"
    :orientation "horizontal"
    ;(systembar-leftside)
    ;(systembar-centerside)
    (systembar-rightside)
  )
)

(defwidget systembar-rightside []
  (box
    :class "systembar-rightside"
    :orientation "horizontal"
    :halign "end"
    :space-evenly "false" 
    :spacing 16
    (systembar-systray)
    ;(systembar-keyboard-layout)
    ;(systembar-bluetooth)
    ;(systembar-vpn)
    ;(systembar-network)
    ;(systembar-cpu)
    ;(systembar-ram)
    ;(systembar-battery)
    ;(systembar-datetime)
  )
)

(defwidget systembar-systray []
  (systray
    :class "systembar-systray"
    :spacing 5
    :orientation "horizontal"
    :space-evenly "true"
    :icon-size 28
    :prepend-new "true"
  )
)
victorz commented 2 months ago

Could it be because you have set :space-evenly and :prepend-new as strings? They are supposed to be bool values, according to the docs:

https://elkowar.github.io/eww/widgets.html#systray

Does it work if you change it from "true" to true?

keiko37 commented 2 months ago

Could it be because you have set :space-evenly and :prepend-new as strings? They are supposed to be bool values, according to the docs:

https://elkowar.github.io/eww/widgets.html#systray

Does it work if you change it from "true" to true?

I tried and that's didn't help. As I know it's string with boolean type converts to the boolean under the hood. Also I using string variations in other places and everything is ok.

P.S. Sometimes it works. But when it is working most cases it is when you add something into the tray after opening(another words in my case systray just don't restore already opened apps).

victorz commented 2 months ago

What does happen, then? You say it doesn't work properly. Does something happen? An error message when you type eww reload?

keiko37 commented 2 months ago

Nothing happened, just normal behavior. I can see systray container in gtk devtools, but it has 0 width with no content. It should at least show the nm-applet which is enabled every time after boot/reload. But if I try to add width and colors to the space it will be visible. So I think it's enabled, but doesn't want to show the data about current apps.

Tumbleweeds commented 2 months ago

I'm experiencing something similar. I have 3 programs that use the systray: nextcloud client, keepassxc and udiskie. Out of those, only nextcloud client shows in the eww systray, but if I enable systray in dusk (fork of dwm), all three show. I'm still testing, trying to figure out what are the differences in the notification of those three and will post my findings later this week.

TheStachelfisch commented 1 month ago

Having the same issue here, out of all tray items that I have, only Vesktop shows up. Other apps like KeepassXC, syncthing-tray and cbatticon just don't show up. I'm using 0.6.0-unstable-2024-04-26 from nixpkgs-unstable. Is there any way I could debug this further with eww tools? eww debug doesn't provide any data about the system tray.

Fwiw, Trayer also doesn't show any of the system tray icons

g-regex commented 2 weeks ago

I have a similar problem on wayland (hyprland). I don't have many applications at hand to test the tray - only keepassxc and pasystray. Neither of them shows up in the eww tray. In waybar's tray it's working without a problem. For debugging purposes I also tried it on X11 (i3), but it's the same problem there.

TheStachelfisch commented 2 weeks ago

After a bit more observing, I found that the issue only happens, when apps are started before eww itself is started. eww doesn't seem to probe for apps that have already been started before eww has been. For instance if I close all my tray apps, then start eww and after that open all my tray apps again they all show up.

It seems to be, that eww needs to probe for already registered tray apps even after it was started.

fbartelt commented 2 weeks ago

I encountered a similar issue with nm-applet as @keiko37. Using the current release 0.6.0 of eww with i3wm, initially nm-applet wouldn't display its tray icon even when launched after eww and regardless of other trays being initialized. However, this behavior changed after I switched to nm-applet --indicator. Interestingly, the tray icon now appears even when nm-applet is initialized alone.

Here's a snippet from my i3 configuration

exec_always --no-startup-id /home/fbartelt/.config/eww/launch.sh &
exec --no-startup-id nm-applet --indicator

This setup has worked for me after several reboots, but I cannot guarantee it as a 100% solution.

g-regex commented 2 weeks ago

Like in the case of @fbartelt, it unfortunately does not make any difference for me either whether I start applications before or after eww on X11 or wayland (also irrespective of other bars that might display a tray). Besides keepassxc and pasystray, mentioned in my previous post, I also tried nheko and nicotine, which have tray icons. I do not have nm-applet or nextcloud-client installed to test for their behaviour though.