Skip to main content
Topic: System idling while watching YouTube, trying to install caffeine-ng (Read 545 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

System idling while watching YouTube, trying to install caffeine-ng

(tl;dr is below) Hello, I'd say my skill level with Linux is a beginner, but probably closer to intermediate, as I've used Linux in the past and have also dealt with Unix with my job, so I am fairly comfortable with the terminal/console. I've only actively  been using Linux since June on my own computers.  I decided to try out Artix Linux and I'm specifically using the artix-community-gtk-openrc-20220713-x86_64 version of the distro, which uses MATE as its Desktop Environment by default. I've tried searching for similar posts but not a lot came up (in fact, nothing came up for the caffeine  software specifically on this forum's search, a single result where someone mentions "caffeine" as a password for an example ), I tried searching for screensaver related topics, screen dimming, and various others on this page and on various other searches on search engines. For now, my temporary solution was to change it so the Screensaver won't try to activate until 30 minutes of "inactivity", and that should work for most situations, but, I've noticed watching stuff through mpv doesn't cause the screensaver to activate. This is so far the only distro I've experienced this problem with.

I'd seen a few posts mentioning to try using caffeine (specifically https://aur.archlinux.org/packages/caffeine-ng ), I installed all of the listed dependencies, and due to the further below command suggesting it, I changed
Code: [Select]
from setuptools import find_packages
to
Code: [Select]
from setuptools import find_namespace_packages

another suggestion I saw when trying to run  was to change "install" to build or pip, so I changed it to build.
Code: [Select]
python setup.py build
      sudo python setup.py install
      sudo glib-compile-schemas /usr/share/glib-2.0/schemas

Afterwards I got the error message that
Code: [Select]
gi.repository.GLib.GError: g-file-error-quark: Failed to open file “/usr/lib/python3.10/site-packages/caffeine_ng-0.0.post35+gdecd4e0-py3.10.egg/caffeine/assets/glade/proc.glade”: No such file or directory (4)

which, I can confirm, that file or directory doesn't exist, that path only goes up to assets, and trying to search for glade or proc.glade doesn't yield any specific results or results that have any actual suggested fixes.

The only other post I see specifically mentioning that path and file is a post from the Linux Mint forums from 2014, and no one replied to the user who posted it. I know I can disable the screensaver, or change it to something like to only start the screen saver after an hour or longer. I'm sure I could just turn off the monitor when I'm not actively at my computer, but I was just wondering if there were any other suggestions or solutions that wouldn't just involve disabling the screensaver. I tried doing a lot of searches, and was actually going to post about this several hours ago, but instead spent the time trying to find solutions through searches on here and on various search engines. Nothing specific to my situation came up and even on the AUR link, it doesn't seem anyone there is using MATE for their desktop environment (and frankly I am considering changing to another DE as I'm not a huge fan of MATE so far)

Apologies for the lengthy post, I can't seem to find any forum rules either, so hopefully my post isn't breaking anything. I just know giving as many details as possible is preferred. If I've potentially caused any major issues from the dependencies listed on AUR, this particular install isn't meant to be my daily driver just yet, it's more like I'm testing this hardware on my secondary hard drive for this machine. So there wouldn't be any significant loss if I needed to start over somehow.

tl;dr: Trying Artix, I know I can "resolve" this issue by disabling screensaver entirely or making it so the system takes more time to idle. I saw search results mentioning caffeine to prevent the idling issue while watching YouTube, not having a lot of success installing it and little comes up in regards to a missing file.

Re: System idling while watching YouTube, trying to install caffeine-ng

Reply #1
Hello and welcome,

Do you use a laptop?

I use XFCE on several PCs and I systematically uninstall xfce4-power-manager which causes this kind of problem.

If you are using a desktop pc you can try uninstalling mate-power-manager.

Re: System idling while watching YouTube, trying to install caffeine-ng

Reply #2
Thanks for the welcome and the reply tintin.

I am using a desktop, I've had similar issues with one of my laptops, an old Dell Studio 1458, but with Garuda using XFCE; it works without issues sleeping and waking up.  My other newer laptop, I have Linux Mint installed on and it doesn't have any issues with waking up after being put to sleep either.

I'll try uninstalling that and see how it goes, I was considering replacing MATE with XFCE actually, that and/or KDE Plasma. I also found out when my desktop locked itself after 30 minutes of inactivity that I get greeted with a black screen after entering my credentials. I have seen others mentioning this with MATE and I think it was LightDM and light-locker that they were bringing up as a potential culprits for that unlock issue. I'm still looking into it. For now I've disabled both the screen saver and display turning off after x minutes of inactivity, but I'd have to see what happens after leaving my system for a significant amount of time to see if it somehow locks itself disabled. I'll continue to do some research on this particular issue.

Thanks again!

Re: System idling while watching YouTube, trying to install caffeine-ng

Reply #3
I forgot to mention that :
- I also removed light-locker
- I replaced lightdm with sddm and networkmanager with connman, following minor annoyances ; but I can't remember which ones.
Since then, everything has been running smoothly.

You will notice my scientific rigor in solving certain problems. :D

Re: System idling while watching YouTube, trying to install caffeine-ng

Reply #4
I just tried this on kde and it 'just worked'

I didn't need to install any dependancies as the yay AUR helper did that. (Standard warning that you should read the PKGBUILD's of anything getting installed from AUR to check they are not doing any thing bad.)

I didn't need to change any code.

From the caffeine-ng README.md
Quote
caffeine-ng works with the following screensavers / screenlockers:
    Anything that implements the org.freedesktop.ScreenSaver API (this includes KDE, amongst others)
    gnome-screensaver
    XSS
    Xorg + DPMS
    xautolock
    xidlehook.

At a guess Mate is using https://github.com/mate-desktop/mate-screensaver ? caffeine-ng is not specifically listing mate-screensaver as supported. And using github's search did not find org.freedesktop.ScreenSaver  in the code.

So maybe caffeine-ng just does not support mate-screensaver ?

What led you to start editing code? Was caffine-ng failing to run at all or just failing to disable the screensaver ?

Re: System idling while watching YouTube, trying to install caffeine-ng

Reply #5
I guess it is because of MATE, I wasn't aware of the codeberg page. I'll remember that for the future. I somehow completely missed that link on the AUR. I'm still learning, I'm glad I haven't messed anything up beyond repair yet at least. I hope I don't, but you never know what could go wrong.

In any case, that would explain why it didn't work. I am planning to change DE's sometime soon.

I started changing code because the Terminal output said that 'install' in that context was deprecated and 'build' or 'pip' should be used instead. I was also warned in the output of me trying to run setup.py about find_packages and the output said it should be "find_namespace_packages". When I tried to run caffeine-ng it would give an error saying that file/path didn't exist and I couldn't find any information about it from searches. Although, again, me currently using MATE is probably at least part of the reason it wouldn't work correctly.

I'll be more careful from here on, thanks gripped!

Re: System idling while watching YouTube, trying to install caffeine-ng

Reply #6
It sounds like you were trying to build and install it outside of the package management ?
Unless you know what you are doing this can be a bad idea.
Without writing an essay, beyond really trivial scripts and programs you can cause breakage as things you need may get overwritten or just messed up. Python, Perl etc etc.

If it's in the AUR it's better to install from the AUR after reviewing the PKGBUILD(s).
If it isn't it's better to learn how to create your own PKGBUILD to install it.

Useful links:
https://wiki.archlinux.org/title/Arch_User_Repository
https://wiki.archlinux.org/title/Arch_Build_System
https://wiki.archlinux.org/title/PKGBUILD

Re: System idling while watching YouTube, trying to install caffeine-ng

Reply #7
>Apologies for the lengthy post

Absolutely not, you should be proud, a lengthy post where OP explains the problem and what they tried in detail is better compared to a short post with barely any info.