diff --git a/docs/capabilities.md b/docs/capabilities.md index 5baea944..13348341 100644 --- a/docs/capabilities.md +++ b/docs/capabilities.md @@ -110,7 +110,14 @@ your GTK icon theme. Solaar is not using the symbolic versions of these icons because of a bug external to Solaar that results in these icons not changing to the foreground colour in the system tray. This can leave these icons nearly -invisible in dark themes. +invisible in dark themes. It would be useful to be able to switch to +symbolic icons via GTK styling (using something like +`.solaar * { -gtk-icon-style: symbolic; }` in the user's gtk.css) +but most or all current system tray implementations do not allow for this. + +As a temporary hack setting the SOLAAR_TRAY_BATTERY_ICON_SYBOLIC environment +variable will cause Solaar to use symbolic icons for battery levels in the +system tray. [solaar]: https://github.com/pwr-Solaar/Solaar diff --git a/lib/solaar/ui/tray.py b/lib/solaar/ui/tray.py index 02d791aa..d5159a86 100644 --- a/lib/solaar/ui/tray.py +++ b/lib/solaar/ui/tray.py @@ -203,6 +203,9 @@ try: battery_charging = device_status.get(_K.BATTERY_CHARGING) tray_icon_name = _icons.battery(battery_level, battery_charging) + # get around system tray icons not having styling and not having css class + tray_icon_name = tray_icon_name + ( "-symbolic" if "SOLAAR_TRAY_BATTERY_ICON_SYBOLIC" in os.environ else "" ) + description = '%s: %s' % (name, device_status.to_string()) else: # there may be a receiver, but no peripherals @@ -260,6 +263,9 @@ except ImportError: battery_level = device_status.get(_K.BATTERY_LEVEL) battery_charging = device_status.get(_K.BATTERY_CHARGING) tray_icon_name = _icons.battery(battery_level, battery_charging) + + # get around system tray icons not having styling and not having css class + tray_icon_name = tray_icon_name + ( "-symbolic" if "SOLAAR_TRAY_BATTERY_ICON_SYBOLIC" in os.environ else "" ) else: # there may be a receiver, but no peripherals tray_icon_name = _icons.TRAY_OKAY if _devices_info else _icons.TRAY_ATTENTION