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

swaybar renders fcitx's tray icon as red sad face #5645

Closed
Arnavion opened this issue Aug 26, 2020 · 7 comments
Closed

swaybar renders fcitx's tray icon as red sad face #5645

Arnavion opened this issue Aug 26, 2020 · 7 comments
Labels
bug Not working as intended swaybar

Comments

@Arnavion
Copy link

Arnavion commented Aug 26, 2020

(Copying from #4825 (comment) on emersion's request to not reuse that issue.)

swaybar renders fcitx's tray icon as a red sad face just like in #4825:

$ grep -i tray sway-debug.log

00:00:00.115 [swaybar/tray/tray.c:37] Initializing tray
00:00:00.116 [swaybar/tray/watcher.c:202] Registered org.freedesktop.StatusNotifierWatcher
00:00:00.116 [swaybar/tray/watcher.c:186] Failed to acquire service name 'org.kde.StatusNotifierWatcher':another tray is already running
00:00:00.116 [swaybar/tray/host.c:198] Registered org.freedesktop.StatusNotifierHost-93313
00:00:00.117 [swaybar/tray/host.c:198] Registered org.kde.StatusNotifierHost-93313
00:00:00.117 [swaybar/tray/icon.c:313] Failed to load theme 'default' - parsing of file '/home/arnavion/.icons/default/index.theme' failed on line 5 (group 'Icon Theme'): missing required key 'Directories'
00:00:00.120 [swaybar/tray/icon.c:379] Loaded icon themes: Hicolor, Adwaita
00:00:00.132 00:00:00.435 [swaybar/tray/watcher.c:107] Registering Status Notifier Host 'org.freedesktop.StatusNotifierHost-93313'
00:00:00.132 [swaybar/tray/host.c:24] Registering Status Notifier Item 'org.kde.StatusNotifierItem-99416-1/StatusNotifierItem'
00:00:00.132 [swaybar/tray/item.c:152] org.kde.StatusNotifierItem-99416-1/StatusNotifierItem IconThemePath = ''
00:00:00.132 [swaybar/tray/item.c:152] org.kde.StatusNotifierItem-99416-1/StatusNotifierItem Status = 'Active'
00:00:00.132 [swaybar/tray/item.c:152] org.kde.StatusNotifierItem-99416-1/StatusNotifierItem IconName = 'input-keyboard'
00:00:00.132 [swaybar/tray/item.c:121] org.kde.StatusNotifierItem-99416-1/StatusNotifierItem IconPixmap: No such property ('org.kde.StatusNotifierItem.IconPixmap')
00:00:00.132 [swaybar/tray/item.c:152] org.kde.StatusNotifierItem-99416-1/StatusNotifierItem AttentionIconName = ''
00:00:00.132 [swaybar/tray/item.c:121] org.kde.StatusNotifierItem-99416-1/StatusNotifierItem AttentionIconPixmap: No such property ('org.kde.StatusNotifierItem.AttentionIconPixmap')
00:00:00.132 [swaybar/tray/item.c:121] org.kde.StatusNotifierItem-99416-1/StatusNotifierItem ItemIsMenu: No such property ('org.kde.StatusNotifierItem.ItemIsMenu')
00:00:00.132 [swaybar/tray/item.c:152] org.kde.StatusNotifierItem-99416-1/StatusNotifierItem Menu = '/MenuBar'
00:00:02.062 [swaybar/tray/host.c:24] Registering Status Notifier Item 'org.kde.StatusNotifierItem-93317-1/StatusNotifierItem'
00:00:02.063 [swaybar/tray/item.c:152] org.kde.StatusNotifierItem-93317-1/StatusNotifierItem IconThemePath = ''
00:00:02.063 [swaybar/tray/item.c:152] org.kde.StatusNotifierItem-93317-1/StatusNotifierItem Status = 'Active'
00:00:02.063 [swaybar/tray/item.c:152] org.kde.StatusNotifierItem-93317-1/StatusNotifierItem IconName = 'input-keyboard'
00:00:02.072 [swaybar/tray/item.c:121] org.kde.StatusNotifierItem-93317-1/StatusNotifierItem IconPixmap: No such property ('org.kde.StatusNotifierItem.IconPixmap')
00:00:02.072 [swaybar/tray/item.c:152] org.kde.StatusNotifierItem-93317-1/StatusNotifierItem AttentionIconName = ''
00:00:02.072 [swaybar/tray/item.c:121] org.kde.StatusNotifierItem-93317-1/StatusNotifierItem AttentionIconPixmap: No such property ('org.kde.StatusNotifierItem.AttentionIconPixmap')
00:00:02.072 [swaybar/tray/item.c:121] org.kde.StatusNotifierItem-93317-1/StatusNotifierItem ItemIsMenu: No such property ('org.kde.StatusNotifierItem.ItemIsMenu')
00:00:02.072 [swaybar/tray/item.c:152] org.kde.StatusNotifierItem-93317-1/StatusNotifierItem Menu = '/MenuBar'

(There are two icons because the first one is from fcitx running in my original tty with a non-debug sway session, and the second is from the fcitx exec_always'd into the debug sway session.)

fcitx according to dbus has:

image

(Note: This image is from the original issue, which is why the dbus names doesn't match.)

To clarify for anyone not familiar with d-feet's UI: .IconName is set to "input-keyboard", .IconThemePath is set to "". I did not query the other properties which is why they don't show their values.

Looking at swaybar/tray/item.c, the error logs are benign since it just gets whatever properties it can. It does look up icon using the value it got from IconName, so I'm not sure why it's failing to find it.

$ find /usr/share/icons -name 'input-keyboard.*'

/usr/share/icons/Adwaita/16x16/legacy/input-keyboard.png
/usr/share/icons/Adwaita/22x22/legacy/input-keyboard.png
/usr/share/icons/Adwaita/24x24/legacy/input-keyboard.png
/usr/share/icons/Adwaita/256x256/legacy/input-keyboard.png
/usr/share/icons/Adwaita/32x32/legacy/input-keyboard.png
/usr/share/icons/Adwaita/48x48/legacy/input-keyboard.png

FWIW the tray icon renders fine with waybar. It appears to be using the /usr/share/icons/Adwaita/16x16/legacy/input-keyboard.png one.

And in case that index.theme error is relevant:

$ cat ~/.icons/default/index.theme

# This file is written by LXAppearance. Do not edit.
[Icon Theme]
Name=Default
Comment=Default Cursor Theme
Inherits=Adwaita
@Arnavion Arnavion added the bug Not working as intended label Aug 26, 2020
@ianyfan
Copy link
Contributor

ianyfan commented Aug 30, 2020

Set your bar's icon theme to Adwaita

@Arnavion
Copy link
Author

Thanks. That works, and also makes sense:

icon_theme <name>

   Sets the icon theme that sway will look for item icons in. This option has no default value, because sway will always default to the fallback theme, hicolor.

I guess waybar works by default because it gets the icon theme from the general GTK configuration.

@ianyfan
Copy link
Contributor

ianyfan commented Aug 31, 2020

It would probably help to add a debug message about which icon theme is being used.

@tobiasjakobi
Copy link

I had the same problem and setting the icon theme to Adwaita indeed now renders the fcitx symbol correctly. However sway stil spams the journal with messages of this type:
sway[6294]: 00:02:39.215 [ERROR] [swaybar/tray/item.c:127] org.kde.StatusNotifierItem-6307-1/StatusNotifierItem IconPixmap: No such property ('org.kde.StatusNotifierItem.IconPixmap')

Anything I am missing here?

@amano-kenji
Copy link

This issue appeared again after the latest system update. The icon theme is Adwaita.

@TinusgragLin
Copy link

TinusgragLin commented Jun 16, 2023

This issue appeared again after the latest system update. The icon theme is Adwaita.

@amano-kenji Happened to me this morning after I updated my Arch. I tried installing a new random icon theme (cutefish-icons, specifically) and using the new icon theme instead. Turns out it works!

@neilbags
Copy link

neilbags commented Dec 1, 2023

I fixed this in Ubuntu 23.10 by installing adwaita-icon-theme-full and setting gtk-icon-theme-name=Adwaita in .config/gtk-3.0/settings.ini

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended swaybar
Development

No branches or pull requests

7 participants