caffeine fails to start

Bug #691759 reported by Christopher Stubban
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Caffeine
Fix Released
Undecided
Isaiah Heyer
Arch Linux
New
Undecided
Unassigned

Bug Description

when trying to start caffeine with the following command, on Ubuntu 10.04:

caffeine -a

Traceback (most recent call last):
  File "/usr/bin/caffeine", line 40, in <module>
    import caffeine
  File "/usr/bin/../share/pyshared/caffeine/__init__.py", line 171, in <module>
    from caffeine.main import main
  File "/usr/bin/../share/pyshared/caffeine/main.py", line 53, in <module>
    generic = icon_theme.load_icon("application-x-executable", 16, gtk.ICON_LOOKUP_NO_SVG)
glib.GError: Icon 'application-x-executable' not present in theme

It brings me back to the command line.
Does something else need to be installed?

Related branches

Revision history for this message
graysky (da-audiophile) wrote :

Dunno if I should open a new bug report or just paste my slightly different output here.

I'm on Arch x86_64 which is up-to-date as of 22-Dec. When I attempt to run caffeine I get:

$ caffeine
Traceback (most recent call last):
  File "/usr/bin/caffeine", line 40, in <module>
    import caffeine
  File "/usr/lib/python2.7/site-packages/caffeine/__init__.py", line 25, in <module>
    from xdg.BaseDirectory import xdg_config_home
ImportError: No module named xdg.BaseDirectory

Arch is currently using python2 version 2.7.1

Revision history for this message
graysky (da-audiophile) wrote :

Forgot to add: Arch uses a simple build system for make non-repo packages. See the PKGBUILD file at the following URL for the dependencies and steps taken to build the package which could help troubleshooting.

http://aur.archlinux.org/packages/caffeine/caffeine/PKGBUILD

Revision history for this message
graysky (da-audiophile) wrote :

Another piece of info: if I build the very same package on Arch i686, caffeine runs just fine; this problem seems unique to x86_64.

Revision history for this message
Isaiah Heyer (freshapplepy) wrote :

I think you need the python-xdg package, although I am not sure why that would only affect x86_64.

Revision history for this message
Christopher Stubban (stoobers) wrote :

I'm using the package through apt-get in ubuntu 10.04.

caffeine -a

Traceback (most recent call last):
  File "/usr/bin/caffeine", line 40, in <module>
    import caffeine
  File "/usr/bin/../share/pyshared/caffeine/__init__.py", line 171, in <module>
    from caffeine.main import main
  File "/usr/bin/../share/pyshared/caffeine/main.py", line 53, in <module>
    generic = icon_theme.load_icon("application-x-executable", 16, gtk.ICON_LOOKUP_NO_SVG)
glib.GError: Icon 'application-x-executable' not present in theme

If possible, can someone point me in a possible direction as to how I may fix this? I'm new to python and I'm not sure where to look first. Where can I read about this "load_icon" method and is there a way I can substitute a different icon?

Or is there a library missing? Am I running the wrong version of python.

Revision history for this message
Isaiah Heyer (freshapplepy) wrote :

I am working on adding a fallback if the icon `application-x-executable` is not provided by your theme.

Changed in caffeine:
status: New → Fix Committed
assignee: nobody → Isaiah Heyer (freshapplepy)
Revision history for this message
Christopher Stubban (stoobers) wrote :

Hi,

I appreciate that very much. Also, could you point me where I can read about this function? I see the problem is if the icon (little picture?" is not in the "theme", so how would I figure out what themes are available and what icons are in what themes?

Is it really as simple as there not being an icon with that name?

Thanks,
stoobers

Revision history for this message
Isaiah Heyer (freshapplepy) wrote :

http://library.gnome.org/devel/pygtk/stable/class-gtkicontheme.html#method-gtkicontheme--load-icon

Yes it really is as simple as there not being an icon with that name and size being available in the theme you are using.
You could use this program too see what icons are included in a particular theme https://launchpad.net/icon-library/

Revision history for this message
Christopher Stubban (stoobers) wrote :

Hi,
I got rid of this bug for ubuntu/kubuntu 10.04. I may have created other bugs in the process, but this change allows me to launch "caffeine -a", then quit out of it with ctrl-c

Upon doing this, the screen saver was suppressed for 30 minutes, so it looks like the fix sort of works. I picked the ibus-engine icon because it looked like a gear and was innocent enough looking.

To edit the file, I used vim, with the command:
sudo vim /usr/bin/../share/pyshared/caffeine/main.py

The line producing the error shows up on line 53:
Before:
generic = icon_theme.load_icon("application-x-executable", 16, gtk.ICON_LOOKUP_NO_SVG)

After:
generic = icon_theme.load_icon("ibus-engine", 16, gtk.ICON_LOOKUP_FORCE_SVG)

Hope this helps.
stoobers

Revision history for this message
Christopher Stubban (stoobers) wrote :

Also,
https://launchpad.net/icon-library/

This "icon-library" program, available at the link above, allowed me to view what icons and their names were actually available.

Thank for the recommendation, Isaiah Heyer.
stoobers

Revision history for this message
graysky (da-audiophile) wrote :

Quote from Isaiah Heyer: "I think you need the python-xdg package, although I am not sure why that would only affect x86_64."

This was the problem! On Arch this package is named "pyxdg" and installing it fixed the problem. Thank you. I will email the maintainer of the Arch package to see that it gets included in the deps array.

Revision history for this message
Mr_NooOooB (dooodbooob) wrote :

$ caffeine

(process:16154): Gtk-WARNING **: Locale not supported by C library.
 Using the fallback 'C' locale.
Traceback (most recent call last):
  File "/usr/bin/caffeine", line 40, in <module>
    import caffeine
  File "/usr/lib/python2.7/site-packages/caffeine/__init__.py", line 143, in <module>
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python2.7/locale.py", line 539, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

Revision history for this message
Camille Appert (bibinou) wrote :

Mr_NooOooB (dooodbooob) could you make a new bug using this link : https://bugs.launchpad.net/caffeine/+filebug
Thank you.

Reuben Thomas (rrt)
Changed in caffeine:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.