scorpion-26 / gBar

Blazingly fast status bar written with GTK
MIT License
459 stars 17 forks source link

Can't load svg icons for traybar #60

Closed chmanie closed 9 months ago

chmanie commented 9 months ago

Please fill out this form and delete the defaults(everything not in bold font), so I can help you better Describe the bug

Icons in the traybar are not shown. This log is coming up:

| gBar bar 1                                                  
Set value for AudioInput: false
Set value for AudioMaxVolume: 100
Set value for AudioMinVolume: 0
Set value for AudioNumbers: false
Set value for AudioRevealer: false
Set value for AudioScrollSpeed: 5
Set value for BatteryFolder: /sys/class/power_supply/BAT1
Set value for CPUThermalZone: /sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp1_input
Set value for CenterTime: true
Set value for DateTimeLocale: 
Set value for DateTimeStyle: %a %D - %H:%M:%S %Z
Set value for DefaultWorkspaceSymbol: 
Set value for DiskPartition: /
Set value for EnableSNI: true
Set value for ExitCommand: killall Hyprland
Set value for Location: T
Set value for LockCommand: ~/.config/scripts/sys.sh lock
Set value for MaxDownloadBytes: 10485760
Set value for MaxUploadBytes: 5242880
Set value for MinDownloadBytes: 0
Set value for MinUploadBytes: 0
Set value for NetworkAdapter: eno1
Set value for NetworkWidget: true
Set value for NumWorkspaces: 9
Set value for SensorTooltips: true
Set value for SuspendCommand: systemctl suspend
Set value for TimeSpace: 300
Set value for UseHyprlandIPC: true
Set value for WorkspaceScrollInvert: false
Set value for WorkspaceScrollOnMonitor: true
Wayland: Registering monitor eDP-1 at ID 0
Wayland: Registering monitor DP-2 at ID 1
NVML not found, disabling Nvidia GPU
AMD GPU not found, disabling AMD GPU
PulseAudio: Context is ready!
PulseAudio: Update info
Cannot open network device! Disabling Network widget.
CSS found and loaded successfully!

(gBar:660164): Gtk-WARNING **: 18:33:05.075: Theme parsing error: gtk.css:6691:68: Invalid name of pseudo-class
SNI: Clearing old children
Invalid child!
sh: line 1: checkupdates: command not found
GetOutdatedPackages: Invalid command. Disabling package widget!
SNI: Registered Item :1.583 /org/ayatana/NotificationItem/nm_applet
SNI: Registered Item :1.586 /org/ayatana/NotificationItem/udiskie
SNI: Creating Item :1.586 /org/ayatana/NotificationItem/udiskie
SNI: Searching icon drive-removable-media-usb-pendrive in /nix/store/l7a67y2wh5ky2rm03rzrg1k2vnn29918-desktops/share/icons
SNI: Searching icon drive-removable-media-usb-pendrive in /home/chris/.nix-profile/share/icons
SNI: Searching icon drive-removable-media-usb-pendrive in /etc/profiles/per-user/chris/share/icons
SNI: Searching icon drive-removable-media-usb-pendrive in /nix/var/nix/profiles/default/share/icons
SNI: Searching icon drive-removable-media-usb-pendrive in /run/current-system/sw/share/icons
SNI: Searching icon drive-removable-media-usb-pendrive in /usr/share/icons
SNI: Creating icon from "/usr/share/icons/Papirus/16x16/devices/drive-removable-media-usb-pendrive.svg"
SNI: Error loading svg /usr/share/icons/Papirus/16x16/devices/drive-removable-media-usb-pendrive.svg: Couldn’t recognize the image file format for file “/usr/share/icons/Papirus/16x16/devices/drive-removable-media-usb-pendrive.svg”
SNI: Menu object path: /org/ayatana/NotificationItem/udiskie/Menu
SNI: Allocating static name buffer for :1.586
SNI: Creating Item :1.583 /org/ayatana/NotificationItem/nm_applet
SNI: Searching icon nm-device-wired in /nix/store/l7a67y2wh5ky2rm03rzrg1k2vnn29918-desktops/share/icons
SNI: Searching icon nm-device-wired in /home/chris/.nix-profile/share/icons
SNI: Searching icon nm-device-wired in /etc/profiles/per-user/chris/share/icons
SNI: Searching icon nm-device-wired in /nix/var/nix/profiles/default/share/icons
SNI: Searching icon nm-device-wired in /run/current-system/sw/share/icons
SNI: Searching icon nm-device-wired in /usr/share/icons
SNI: Creating icon from "/usr/share/icons/Papirus/16x16/panel/nm-device-wired.svg"
SNI: Error loading svg /usr/share/icons/Papirus/16x16/panel/nm-device-wired.svg: Couldn’t recognize the image file format for file “/usr/share/icons/Papirus/16x16/panel/nm-device-wired.svg”
SNI: Menu object path: /org/ayatana/NotificationItem/nm_applet/Menu
SNI: Allocating static name buffer for :1.583
SNI: Clearing old children
Remove widget from parent
Destroy widget and its children

Steps to Reproduce

What did you do, that triggered the issue?

  1. Use the Papirus icon set
  2. Open the bar
  3. Tray icons are not visible

I am on NixOS.

This is the output of cat /usr/share/icons/Papirus/16x16/panel/nm-device-wired.svg

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" version="1.1">
 <defs>
  <style id="current-color-scheme" type="text/css">
   .ColorScheme-Text { color:#dfdfdf; } .ColorScheme-Highlight { color:#4285f4; } .ColorScheme-NeutralText { color:#ff9800; } .ColorScheme-PositiveText { color:#4caf50; } .ColorScheme-NegativeText { color:#f44336; }
  </style>
 </defs>
 <path style="fill:currentColor" class="ColorScheme-Text" d="m 1,1.0000004 c 0,0 -1,0 -1,1 V 12 c 0,1 1,1 1,1 h 2 l 1,1 h 7 l 1,-1 h 2 c 0,0 1,0.13 1,-1 V 2.0000004 c 0,-1 -1,-1 -1,-1 z m 1,2 h 1 v 2 h 1 v -2 h 1 v 2 h 1 v -2 h 1 v 2 h 1 v -2 h 1 v 2 h 1 v -2 h 1 v 2 h 1 v -2 h 1 V 11 h -2 l -1,1 H 5 L 4,11 H 2 Z"/>
</svg>

Expected behavior

Tray icons should come up

Screenshots/Error logs

Please include as much information about the crash/bug as possible.

Config:

# Generated by Home Manager
AudioInput: false
AudioMaxVolume: 100
AudioMinVolume: 0
AudioNumbers: false
AudioRevealer: false
AudioScrollSpeed: 5
BatteryFolder: /sys/class/power_supply/BAT1
CPUThermalZone: /sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp1_input
CenterTime: true
DateTimeLocale: 
DateTimeStyle: %a %D - %H:%M:%S %Z
DefaultWorkspaceSymbol: 
DiskPartition: /
EnableSNI: true
ExitCommand: killall Hyprland
Location: T
LockCommand: ~/.config/scripts/sys.sh lock
MaxDownloadBytes: 10485760
MaxUploadBytes: 5242880
MinDownloadBytes: 0
MinUploadBytes: 0
NetworkAdapter: eno1
NetworkWidget: true
NumWorkspaces: 9
SensorTooltips: true
SuspendCommand: systemctl suspend
TimeSpace: 300
UseHyprlandIPC: true
WorkspaceScrollInvert: false
WorkspaceScrollOnMonitor: true

Information about your system and gBar

scorpion-26 commented 9 months ago

Tried the provided svg, works for me. Do you have by chance forgot to install librsvg (You need that to load svgs)? If not, what does gdk-pixbuf-query-loaders say?

chmanie commented 9 months ago

:bow: I'm sorry, this one is on me. I didn't even know about the existence of lbrsvg. Thank you so much for shedding some light on this! Case closed :)

EDIT: here's a solution on how to solve it on NixOS: https://discourse.nixos.org/t/svg-icons-not-shown/32173