Random thoughts shooting out of volatile mind
iBus tray icon issue fix
I use Debian Sid with KDE 4.4 and use iBus as IME for using Indic languages. But recently the iBus tray icon was not loading and a white patch used to appear which looked ugly. To see what is going on I ran ibus in debug mode using following command.
ibus-daemon -xvr
I got the following message in the terminal
/usr/share/ibus/ui/gtk/icon.py:35: GtkWarning: Could not find the icon 'ibus-keyboard'. The 'hicolor' theme
was not found either, perhaps you need to install it.
You can get a copy from:
The message clearly indicates the Gtk system was unable to find out icon named ibus-keyboard. To debug this issue I opened the file /usr/share/ibus/ui/gtk/icon.py to see if the name or path of icon is in the file. Frankly I'm a noob in PyGtk programming and didn't understand any content present with in the file, but a line attracted my attention and thought of trying it out. Following is what I did in Python console.
Python 2.6.6rc1+ (r266rc1:83691, Aug 5 2010, 19:21:55)
[GCC 4.4.5 20100728 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gtk
** Message: pygobject_register_sinkfunc is deprecated (GtkWindow)
** Message: pygobject_register_sinkfunc is deprecated (GtkInvisible)
** Message: pygobject_register_sinkfunc is deprecated (GtkObject)
/usr/lib/pymodules/python2.6/gtk-2.0/gtk/__init__.py:40: RuntimeWarning: tp_compare didn't return -1 or -2 for exception
from gtk import _gtk
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.6/gtk-2.0/gi/__init__.py", line 27, in <module>
from gi.repository import GObject
ImportError: cannot import name GObject
>>> icon_theme = gtk.icon_theme_get_default()
>>> icon_theme.get_search_path()
('/home/vasudev/.icons', '/home/vasudev/.local/share/icons', '$XDG_DATA_DIRS/icons', '/usr/share/akonadi/agents/icons', '/usr/share/akonadi/agents/icons', '$XDG_DATA_DIRS/pixmaps', '/usr/share/akonadi/agents/pixmaps', '/usr/share/akonadi/agents/pixmaps')
I have made the line which gave me a hint to find this fix bold. Clearly the normal Gtk icon folder path is not present in the image search path. (i.e /usr/share/icon where the iBus icon is present). I'm not sure whether this is a bug or normal behaviour but whatever it is below is the fix which makes the iBus icon reappear in tray.
ln /usr/share/icons/hicolor/scalable/apps/ibus-keyboard.svg ~/.local/share/icons/
This is what above command did, it created a hard link of the icon in one of the directory where Gtk module is looking for icon. Thats it relaunch the iBus and tray icon should be fixed by now ! :)
Posted by: copyninja on Thursday, 19 August 2010

blog comments powered by Disqus
Fork me on GitHub