caffeine on LMDE

Archived topics about LMDE 1 and LMDE 2
Locked
bikepunk

caffeine on LMDE

Post by bikepunk »

Hi

I'm trying to install caffeine: https://launchpad.net/caffeine on LMDE and I meet a lot of trouble since it seems this package is developed for ubuntu and not debian.

since it's not recomended to use ppa on LMDE ( http://forums.linuxmint.com/viewtopic.p ... 9&p=519506 ) I'm trying to compile caffein from sources.
see : http://www.lucidelectricdreams.com/2011 ... ra-16.html for details

for some reason I do not have glib-compile-schemas neither /usr/share/caffeine/images/ and /usr/share/caffeine/glade/

it seems compiling though but when I try to run it, I get:

Code: Select all

Gtk-Message: Failed to load module "canberra-gtk-module"

GLib-GIO-ERROR **: Settings schema 'net.launchpad.caffeine' is not installed

aborting...
Aborted
I do not know python, so I actually don't really know what I am doing... Any help is very welcome. Any other way to disable the screensaver while watching streaming videos is also welcome

related topic: VLC and the screensaver on LMDE: http://forums.linuxmint.com/viewtopic.p ... feine+lmde



PS: this is my first post on this forum.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Arran

Re: caffeine on LMDE

Post by Arran »

Hello Frischling!!!

Kaffeine is in the Repos.
It will install a few KDE based dependencies.
bikepunk

Re: caffeine on LMDE

Post by bikepunk »

:roll: Dude, please read my message :
kaffeine IS NOT caffeine.
I'm not interested in an other media player I just need a smart way to control the screensaver... anyone else
orticultura

Re: caffeine on LMDE

Post by orticultura »

I've installed without any problem caffeine-1.0.1 and it works fine. It's not the newest version.

1. Download the tarball from https://launchpad.net/caffeine
2. tar xvf caffeine-1.0.1.tar.gz && cd caffeine-1.0.1
3. sudo apt-get install python-xlib
4. python setup.py build
5. sudo python setup.py install

You should be now able to start Caffeine by typing caffeine in the command line or by clicking on Applications > Accessories > Caffeine.
When Caffeine starts, an icon of a coffee cup will appear in the task bar.

Hope it helps you
bikepunk

Re: caffeine on LMDE

Post by bikepunk »

Thanks orticultura,

I just tried your way, it gives the same problem as in my first message, may be it's just because I didn't uninstall the unworking 2.4.1 version. I don't know how to uninstall it since is not a deb package... :?

I will contact the caffeine dev team.
dbkblk

Re: caffeine on LMDE

Post by dbkblk »

You just have to install gir1.2-notify-0.7 and here we go !
HisDudeness

Re: caffeine on LMDE

Post by HisDudeness »

I have installed gir1.2-notify-0.7 but still got bikepunk's same error. Then I remembered some actions I had to do about Cinnamon's applets, which had something to do with schemas. I tried that, and got more far, but still get some errors. I'm trying to install the latest version (https://launchpad.net/caffeine/2.4/2.4. ... ic1.tar.gz).

The actions you have to do to get past that error are (here I'm assuming you entered into the extracted folder):
  • Copy the xml you can find in some sub-directory of the recipe folder (this is the proper default name of what the tar.gz contains in 2.4.1 version... mah) into glib-2.0 schemas' one.

    Code: Select all

    sudo cp share/glib-2.0/schemas/net.launchpad.caffeine.gschema.xml /usr/share/glib-2.0/schemas/
  • Make glib-2.0 compile the schemas present in the folder, so that it refreshes its contents and does make a sense of the new one we just put in there

    Code: Select all

    sudo glib-compile-schemas /usr/share/glib-2.0/schemas
The errors I get now when trying to launch caffeine are these:

Code: Select all

dude@susan:~/Downloads/recipe-2.4.1+419$ caffeine
Gtk-Message: Failed to load module "canberra-gtk-module"
ERROR:root:Could not find any typelib for AppIndicator3

Traceback (most recent call last):
  File "/usr/local/bin/caffeine", line 42, in <module>
    caffeine.main()
  File "/usr/local/bin/../lib/python2.7/dist-packages/caffeine/main.py", line 527, in main
    main = GUI()
  File "/usr/local/bin/../lib/python2.7/dist-packages/caffeine/main.py", line 153, in __init__
    self.ProcAdd = ProcAdd()
  File "/usr/local/bin/../lib/python2.7/dist-packages/caffeine/main.py", line 102, in __init__
    "proc.glade"))
  File "/usr/lib/python2.7/dist-packages/gi/types.py", line 43, in function
    return info.invoke(*args, **kwargs)
gi._glib.GError: Failed to open file '/usr/local/lib/python2.7/dist-packages/caffeine/../../../../share/caffeine/glade/proc.glade': Permission denied
Can anyone help me with this? The last line looks like a pretty screwed up path, like he's going deep into /usr/local/lib/python2.7/dist-packages/caffeine (which is an empty directory) and then going back 4 levels to get to /usr/share/caffeine/glade to open proc.glade (and caffeine/ doesn't even exist in /usr/share). What do I have to do? Does anybody know an application like caffeine which is suitable for LMDE?
pclausen

Re: caffeine on LMDE

Post by pclausen »

Using MATE (1.6.0) on testing/updates and downloaded last caffine (2.4.1) from https://launchpad.net/caffeine/+download

Strangely, I can run it as root:

Code: Select all

$ sudo caffine
But it seems a bit wrong. Running non-root which I would prefer I get these errors:

Code: Select all

gi._glib.GError: Failed to open file '/usr/local/lib/python2.7/dist-packages/caffeine/../../../../share/caffeine/glade/proc.glade': Permission denied
Changing the rights of that file to 644 I get this

Code: Select all

gi._glib.GError: Failed to open file '/usr/local/lib/python2.7/dist-packages/caffeine/../../../../share/caffeine/glade/GUI.glade': Permission denied
And then I stopped before having to change the rights of all files on /...

My question: How come these files are not readable by non-root user? Or is something wrong in the setup of caffine?
wittyman37

Re: caffeine on LMDE

Post by wittyman37 »

I am getting similar errors on LMDE when trying to compile and install caffeine 2.5. I am currently downloading a large amount of updates though, so perhaps that will help! :?
wittyman37

Re: caffeine on LMDE

Post by wittyman37 »

I was able to get caffeine running from the terminal with sudo caffeine only from a terminal after installing gir1.2-appindicator3-0.1

I also get these errors when trying to disable the screensaver:

Code: Select all

sudo caffeine

Fontconfig warning: "/etc/fonts/conf.d/53-monospace-lcd-filter.conf", line 10: Having multiple values in <test> isn't supported and may not work as expected
Traceback (most recent call last):
  File "/usr/local/bin/../lib/python2.7/dist-packages/caffeine/main.py", line 225, in on_activate_menuitem_activate
    self.toggleActivated()
  File "/usr/local/bin/../lib/python2.7/dist-packages/caffeine/main.py", line 174, in toggleActivated
    self.Core.toggleActivated()
  File "/usr/local/bin/../lib/python2.7/dist-packages/caffeine/core.py", line 114, in toggleActivated
    self._performTogglingActions()
  File "/usr/local/bin/../lib/python2.7/dist-packages/caffeine/core.py", line 128, in _performTogglingActions
    self._toggle()
  File "/usr/local/bin/../lib/python2.7/dist-packages/caffeine/core.py", line 140, in _toggle
    self.susuProxy = bus.get_object('org.freedesktop.ScreenSaver', '/org/freedesktop/ScreenSaver')
  File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 241, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 248, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 180, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 278, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ScreenSaver was not provided by any .service files
Traceback (most recent call last):
  File "/usr/local/bin/../lib/python2.7/dist-packages/caffeine/main.py", line 225, in on_activate_menuitem_activate
    self.toggleActivated()
  File "/usr/local/bin/../lib/python2.7/dist-packages/caffeine/main.py", line 174, in toggleActivated
    self.Core.toggleActivated()
  File "/usr/local/bin/../lib/python2.7/dist-packages/caffeine/core.py", line 114, in toggleActivated
    self._performTogglingActions()
  File "/usr/local/bin/../lib/python2.7/dist-packages/caffeine/core.py", line 128, in _performTogglingActions
    self._toggle()
  File "/usr/local/bin/../lib/python2.7/dist-packages/caffeine/core.py", line 140, in _toggle
    self.susuProxy = bus.get_object('org.freedesktop.ScreenSaver', '/org/freedesktop/ScreenSaver')
  File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 241, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 248, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 180, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 278, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ScreenSaver was not provided by any .service files
wittyman37

Re: caffeine on LMDE

Post by wittyman37 »

While I haven't gotten caffeine to work, I have found a similar applet for Cinnamon in the Get more applets online section called "Screensaver inhibitor". I just tested it on my LMDE UP7 and the screensaver still came on. I know that on the UP7 update cinnamon desktop changed from gnome-screensaver to cinnamon-screensaver, so I think that is the problem.
wittyman37

Re: caffeine on LMDE

Post by wittyman37 »

So I discovered that for whatever reason, when I downloaded updates, my system did not install cinnamon-screensaver! So I installed it and now the screensaver inhibitor works! :D
tunist

Re: caffeine on LMDE

Post by tunist »

if anyone resolved this for mate edition of lmde, i'd like to know how - caffeine is useful to me and currently i cannot install due to:
ERROR:root:Could not find any typelib for AppIndicator3
Monsta
Level 10
Level 10
Posts: 3071
Joined: Fri Aug 19, 2011 3:46 am

Re: caffeine on LMDE

Post by Monsta »

tunist wrote:ERROR:root:Could not find any typelib for AppIndicator3

Code: Select all

apt install gir1.2-appindicator3-0.1
tunist

Re: caffeine on LMDE

Post by tunist »

aha, great - now caffeine is installed and running. thanks so much. :)
HisDudeness

Re: caffeine on LMDE

Post by HisDudeness »

Hi everyone! I'm back again! I was starting over on a brand new LMDE install, so I did nothing of the previous schemas copying or things like that.

Anyway, just installing gir1.2-appindicator3-0.1 makes it work: you can run caffeine directly from the bin folder, or install it the way orticultura said. Anyway, I'm still encountering a problem: when I close the program, I get the system starting sound and my graphical environment gets screwed up. Plus, I can't see anything which is written in the terminal. Maybe it is more understandable with screenshots.

I go from this to this.

Even a cinnamon --replace does not work. I have to log out and back in. I'm using caffeine 2.6.2 on a Cinnamon x86_64 LMDE install. Can anyone help me?
HisDudeness

Re: caffeine on LMDE

Post by HisDudeness »

Update: this does not happen with previous versions: caffeine 2.6.1 does not give this problem, while 2.5 apparently gives the problem only if you crtl+C it from terminal, and doesn't if you close it from the status bar icon. My best advice is to install 2.5, the last with configure menu, so that you can manually choose which applications should activate caffeine automatically.
  • Download it from here
  • Run

    Code: Select all

    sudo apt-get install python-xlib gir1.2-notify-0.7 gir1.2-appindicator3-0.1
    (Thanks to orticultura and Monsta)
  • Extract the package where you want, and navigate to the root folder ("caffeine") of the extracted package
  • Run

    Code: Select all

    python setup.py build
  • Run

    Code: Select all

    sudo python setup.py install --record files.txt
    (The last part is useful for a quick, easy and complete uninstall: thanks to Martin v. Löwis)
You should now be able to run it by typing "caffeine" in the terminal. If you want a voice in your start menu, just create a caffeine.desktop file in /usr/share/applications/ with the adequate content.

To uninstall it, you manually have to remove all the files the installation created. But, thanks to Martin v. Löwis, all those files are written inside our files.txt document inside the caffeine folder. To remove caffeine, just run

Code: Select all

cat files.txt | sudo xargs rm -rf
to eliminate all the files enumerated inside files.txt.

Anyone having problems just write inside here!
HisDudeness

Re: caffeine on LMDE

Post by HisDudeness »

I have to rectify once again (I hope it is the last time). Caffeine screws up my DE upon exit if it is active in the moment I quit, i.e. if he option "Disable Screensaver" is activated, automatically or manually. Doing that a second time further changes my icon set. New instances of terminal do not get all black, only the ones that were open in the moment of closure do. If I open a terminal session after that happened, I can read what's written on it. What an odd thing.
Locked

Return to “LMDE Archive”