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

System tray symbolic icon not visible when bar is black #4816

Closed
2 tasks done
dawin64 opened this issue May 15, 2024 · 7 comments
Closed
2 tasks done

System tray symbolic icon not visible when bar is black #4816

dawin64 opened this issue May 15, 2024 · 7 comments

Comments

@dawin64
Copy link

dawin64 commented May 15, 2024

Issue description

I am using 'volumeicon' on i3 and the symbolic icon appears in white but when I want to use the same program on qtile the icon is black and does not appear(black on black) if I would use widget.Systray(background="ffffff") it would work but this is not a good solution in my opinion. I could not find any information in the documentation if I can change the icon color of symbolic icons, but when the color is too dark the symbolic icon should be the inverse.

Version

0.25.1.dev0+g005da458.d202440413

Backend

X11 (default)

Config

widget.Systray(),

Logs

No response

Required

  • I have searched past issues to see if this bug has already been reported, and it hasn't been.
  • I understand that people give their precious time for free, and thus I've done my very best to make this problem as easy as possible to investigate.
@elParaguayo
Copy link
Member

The widget doesn't select which icon to draw this is done by the relevant program itself. I would expect this to be determined by some theme setting elsewhere. However, I am not sure why it would work on i3 and not on qtile as both should benefit from the same theme configs (unless you put something specific in your i3 config).

@dawin64
Copy link
Author

dawin64 commented May 15, 2024

Maybe something with _NET_SYSTEM_TRAY_COLORS for GTK+ 3? I don't have any themes installed manually I only use Adwaita icons and also never set it anywhere.

Copy link

This issue is stale because it has been open 90 days with no activity. Remove the status: stale label or comment, or this will be closed in 30 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2024
@richcarni
Copy link

richcarni commented Sep 13, 2024

I had the same issue with the network manager applet, nm-applet

As suggested by @dawin64, _NET_SYSTEM_TRAY_COLORS was a solution for me. The most helpful thing I could find about it was this: https://awesome.naquadah.narkive.com/GbuwM9WP/systray-and-net-system-tray-colors

So I ended up hacking systray.py. After the line

win = conn.create_window(-1, -1, 1, 1)

I added

os.system(f"xprop -id {win.wid} -format _NET_SYSTEM_TRAY_COLORS 32c -set _NET_SYSTEM_TRAY_COLORS 65535,65535,65535,65535,8670,8670,65535,32385,0,8670,65535,8670")

Perhaps we could add a proper option to the systray widget to set this color?

UPDATE
For anyone wanting to try this, I figured out how to do it in config.py...

from libqtile import qtile
import os

def set_tray_colors():
    for id, window in qtile.windows_map.items():
        if isinstance(window, widget.systray.Systray):
            os.system(f"xprop -id {id} -format _NET_SYSTEM_TRAY_COLORS 32c -set _NET_SYSTEM_TRAY_COLORS 65535,65535,65535,65535,8670,8670,65535,32385,0,8670,65535,8670")

@hook.subscribe.startup
def startup():
    set_tray_colors()

@hook.subscribe.startup_once
def startup_once():
    set_tray_colors()
    # autostart apps here

@elParaguayo
Copy link
Member

It would be easy enough to add an option to the widget to set this but do you know the meaning of the different values being set?

@richcarni
Copy link

I had to do some research on this. From what I can gather the _NET_SYSTEM_TRAY_COLORS atom is used by some gtk3 apps to stylise symbolic icons. It doesn't appear to have ever been adopted into the desktop standard and was probably never used that widely

Anyway, the original link I posted also has a link to this gtk commit, which has some more detail: https://mail.gnome.org/archives/commits-list/2010-April/msg09154.html

Basically, the numbers are 4 RGB triplets (16 bit) for:

  1. foreground color
  2. error color
  3. warning color
  4. success color

So the values I used are white, red, orange, green respectively. I'm not sure 2-4 are important/used. I probably wouldn't expose these unless someone reported a case where they would be useful

I'd be willing to have a go at a PR but it wasn't immediately obvious to me how to create/set an atom (without using a system call)

As a somewhat related question, is the idea that StatusNotifier will replace Systray or is this really dependent on apps adding support for StatusNotifier icons? I tried nm-applet and keepassxc but they didn't display an icon (blueman did)

@ervinpopescu
Copy link
Contributor

As a somewhat related question, is the idea that StatusNotifier will replace Systray or is this really dependent on apps adding support for StatusNotifier icons? I tried nm-applet and keepassxc but they didn't display an icon (blueman did)

#4995 (comment)
#4995 (comment)

Basically, there's talk about a new standard in town, designed to deprecate both Systray and StatusNotifier.

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

No branches or pull requests

4 participants