Caffeine-ng 4.2.0-2 works only from the console after plasma update

Hi guys! I have been using this package for a long time without any problems, but last system upgrade something weird occurred. When I try to launch caffeine from plasma menu, the app doesn’t start and I get this in the journal:

caffeine[10853]:   File "/usr/bin/caffeine", line 3, in <module>
caffeine[10853]:     from caffeine.cli import cli
caffeine[10853]:   File "/usr/lib/python3.13/site-packages/caffeine/__init__.py", line 37, in <module>
caffeine[10853]:   File "/usr/lib/python3.13/site-packages/caffeine/__init__.py", line 30, in init_translations
systemd[829]: app-caffeine@dc6941742c114263b927c8a30f445299.service: Main process exited, code=exited, status=1/FAILURE
systemd[829]: app-caffeine@dc6941742c114263b927c8a30f445299.service: Failed with result 'exit-code'.

But, if I launch it from a terminal, it works:

 > caffeine &
[1] 11541
(caffeine:11541): libayatana-appindicator-WARNING **: 12:18:19.401: libayatana-appindicator is deprecated. Please use libayatana-appindicator-glib in newly written code.
No property specified.

Very weird!
I tried to rebuild the dependencies packages following this post but I am getting this error (I’ll just post one but it gives one of these for each package, which is a lot!):

Failed to read AUR data from /var/lib/pacman/sync/packages-meta-ext-v1.json.gz : Error opening file /var/lib/pacman/sync/packages-meta-ext-v1.json.gz: No such file or directory
Error: target not found: python-psutil

But then I achieve this with yay, running:

yay -S --rebuild $(yay -Qqo /usr/lib/python3.13/site-packages/)

but the results are the same. Any ideas what could be wrong with my system? It worked for a long time and survived several upgrades. I eventually had to recompile some aur python packages to make it work again but now I am at a loss. Seems to be something very little because it’s basically working, but I can’t find what it is…
Last but not least, I leave some system info.

Operating System: Manjaro Linux 
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Kernel Version: 6.12.28-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 12 × 12th Gen Intel® Core™ i5-1235U
Memory: 15,4 GiB of RAM
Graphics Processor: Intel® Graphics
Manufacturer: EXO S.A.
Product Name: Smart G12
System Version: ADL_P_IDL525_S_S3_V0.59.3

I don’t want to make the post unnecessarily long, so let me know if need anything else.

Thanks in advance!.
PD: If you know any alternative to caffeine-ng please let me know. I really would like something more easy to maintain and permeable to changes! I couldn’t find any close to replace caffeine.

Not real help, but information:

I just built it - for the first time, not a rebuild - and it went flawlessly.

yay -S caffeine-ng

Did you refresh your list of mirrors before update and rebuild try?

sudo pacman-mirrors -f

Hi Bud!

yes, did all that. I rebuilt the package with yay (after yay -S caffeine-ng, you get the option to make a clean Build), and still got the same result.

It’s weird because from shell launches ok. Seems that somehow the way plasma launches the app mess something app but I cannot put my finger on it.

Click on “Power and Battery” widget in system tray, then click on “Manually Block”.

Screenshot_20250603_212509

Thanks for the tip!
I honestly didn’t knew that option and it can be a good work around.
I am currently launching manually from a terminal and being very careful to not close it down (as a work around).
I really miss the set-and -forget caffeine’s features overriding the effect according to my needs (I am talking about the list of process that activate caffeine and the audio detection for certain apps).
Thanks for taking time to reply!

If you need to completely disable automatic dimming, sleep and screen locking, simply disable them in power management, you don’t need any third party application to do it.

caffeine-ng may simply need rebuilding;


Build it individually;

pamac build caffeine-ng

or;

pamac update --aur

(to rebuild all installed AUR packages)

Regards.

Hi bud…

I can’t run the first command, because a file is missing:

❯ pamac build caffeine-ng
Failed to read AUR data from /var/lib/pacman/sync/packages-meta-ext-v1.json.gz : Error opening file /var/lib/pacman/sync/packages-meta-ext-v1.json.gz: No such file or directory
Failed to read AUR data from /var/lib/pacman/sync/packages-meta-ext-v1.json.gz : Error opening file /var/lib/pacman/sync/packages-meta-ext-v1.json.gz: No such file or directory
Error: target not found: caffeine-ng

And the pacman update --aur works but, as caffeine-ng is installed and no new version is available, doesn’t do anything.
Anyway, after I rebuild the python packages as described above, I do run yay caffeine-ng and re-build (cleanBuild) the package that way (may be is not the same but it worked for me in the past):

❯ yay caffeine-ng
3 aur/caffeine-ng-regex 4.2.0-1 (+0 0.00) (Out-of-date: 2024-06-25) 
    Status bar application able to temporarily inhibit the screensaver and sleep mode.
2 aur/caffeine-ng-git 4.2.0.r45.g8318401-2 (+14 0.00) 
    Status bar application able to temporarily inhibit the screensaver and sleep mode.
1 aur/caffeine-ng 4.2.0-2 (+127 0.62) (Installed)
    Status bar application able to temporarily inhibit the screensaver and sleep mode.
==> Packages to install (eg: 1 2 3, 1-3 or ^4)
==> 1
AUR Explicit (1): caffeine-ng-4.2.0-2
:: PKGBUILD up to date, skipping download: caffeine-ng
  1 caffeine-ng                              (Installed) (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> A
:: Deleting (1/1): /home/username/.cache/yay/caffeine-ng
HEAD is now at 85a2194 Fix error manpage path
Removing caffeine-ng-4.2.0-2-any.pkg.tar.zst
Removing caffeine-ng-4.2.0.tar.gz
Removing src/
  1 caffeine-ng                              (Installed) (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> N
==> Making package: caffeine-ng 4.2.0-2 (2025-06-11 17:46:04)

I happly would try the first pamac command but I don’t know how to get that meta file.

Yes, that’s right. The package will only be updated (rebuilt) using that command if the maintainer has provided a new PKGBUILD file.

pamac build caffeine-ng

should normally build the package - again, only if a new version is available via AUR.

Try this:

pamac update --aur --force-refresh

and then, when that’s completed;

pamac build caffeine-ng

(if a new version is available)

Regards.

Thanks for your detailed instructions.
Now after the pamac update --aur --force-refresh, the pamac build caffeine-ng runs successfully. I don’t know if the same I get with yay but at least is pretty similar.

Here pamac build in case you want to see it;

Mod edit:- There’s normally no need to post the output of a successful build. Deleted.

But after that same issue…
If I launch it from Plasma menu, doesn’t run and I get this into the journal:

❯ journalctl -b --grep=caffeine

jun 12 17:18:47 T213923 systemd[836]: Started Caffeine-ng.
jun 12 17:18:47 T213923 caffeine[15939]:   File "/usr/bin/caffeine", line 3, in <module>
jun 12 17:18:47 T213923 caffeine[15939]:     from caffeine.cli import cli
jun 12 17:18:47 T213923 caffeine[15939]:   File "/usr/lib/python3.13/site-packages/caffeine/__init__.py", line 37, in <module>
jun 12 17:18:47 T213923 caffeine[15939]:   File "/usr/lib/python3.13/site-packages/caffeine/__init__.py", line 30, in init_translations
jun 12 17:18:47 T213923 systemd[836]: app-caffeine@57c978cb7ef644d58bfdaf1014965003.service: Main process exited, code=exited, status=1/FAILURE
jun 12 17:18:47 T213923 systemd[836]: app-caffeine@57c978cb7ef644d58bfdaf1014965003.service: Failed with result 'exit-code'.

If I run it next form a terminal, I get this warning:

❯ caffeine &
[1] 15989
(caffeine:15989): libayatana-appindicator-WARNING **: 17:20:55.608: libayatana-appindicator is deprecated. Please use libayatana-appindicator-glib in newly written code.
No property specified.

But runs OK. And that way in the journal I only see this:

jun 12 17:20:55 T213923 kded6[980]: Registering ":1.117/org/ayatana/NotificationItem/caffeine" to system tray

I don’t know what changes so much when launching it from plasma. I even edited the full path just in case was running another copy (there isn’t any, but just in case). But still nothing.

Thanks again for taking time of your day to reply.

You seem to have multiple issues; however, all I can do is note a few observations, and make a few guesses.

But firstly, a reminder that use of the AUR is not officially supported by Manjaro (when using Stable branch). Generally it’s suggested to use the Unstable branch if intending to rely on packages built from the AUR.


Whether the cause might be Python-related, I can’t say; does Caffeine-ng support your version of Python?.


The output suggests using libayatana-appindicator-glib instead of libayatana-appindicator, which is deprecated. This you can install manually using pacman (as both packages are in the official repos).

The PKGBUILD still lists the deprecated libayatana-appindicator as a dependency, so you would need to edit the PKGBUILD or wait for the package maintainer to do so (if indeed that’s on their “to do” list).

However, I doubt this is in any way related to your issue.


All I can think of is that the .desktop file might need to be recreated (or edited) in order to launch via the menu. Sometimes if there exists a damaged .desktop file in the same directory, that has been known to cause issues.

  • .desktop files are typically installed to /usr/share/applications.

I am installing Caffeine-ng to a VM as I type, to see if I can replicate your issue after a typical build from AUR.


And now that I have done that, I note that the build was successful and when launched via caffeine-ng.desktop linked to from the system menu, I see the Caffeine-NG icon in the system tray. Right-clicking and selecting “Enable Caffeine-ng” seems to work without issue.

In short, there is no issue with either the build process of installation of Caffeine-ng. The issue is limited to your local environment. :eyes:

I suggest creating a new user account to verify whether (or not) Caffeine-ng works as expected.

Regards.