Caffeine in Zorin Lite

In gnome, you can use the systemd-inhibit command, too. But there is another command available in gnome:

gnome-session-inhibit --inhibit idle:suspend --app-id brave-browser --reason video brave-browser

What is the difference to

systemd-inhibit --what=idle:sleep --why=video brave-browser

?
Do those commands only inhibit the automatic suspend? I noticed in gnome, that you can manually go into suspend by pressing the button in start menu even when the block is enabled.

I'll have to test if they work at all in gnome and make a better experience while watching videos (without enabling caffeine or turning off autosuspend).
I noticed, that suspend is blocked when I run in terminal systemctl suspend. Then a message is shown "operation inhibited". Perhaps the GUI ignores those inhibitors?
In my case for what I want to use it, it wouldn't matter.
But I read from the opposite complaints which can happen in gnome: That you want to go into suspend with the GUI and it is not possible because of active inhibitors and you don't get a message.

I searched for the term "gnome-session-inhibit" here in forum, and got not a single search result than mine post. It seems to be a blank spot on the gnome map. As gnome-extensions often disturb each other and make the system less stable, I try to explore alternative ways to the gnome extension caffeine.

One is Gnome-Session inhibit - This is owned and operated by the Desktop Session and exits when it does. It inhibits suspend.
The other is calling on SystemD, a layer above the Gnome Shell, and is more broad. It inhibits Sleep.
Its sleep lock covers suspending/hibernating, while its idle lock covers automatic idle handling.

systemd-inhibit --list

Can show you all options - and that it is the more practical method than routing it through Gnome's session D-Bus.
Above you said:

This is the best route of all you have posted so far, for use on Gnome.
It exits cleanly when the browser does and it targeted; operated by the API that is intended for that use.

1 Like

Thank you Aravisian for the information and the advice.

I tested both commands (one at a time) yesterday in Zorin 18.1, and they worked. The video was playing fine without interruptions in a test of half an hour.

I'll make further tests and compare it with disabled autosuspend/screensaver and the gnome-extension caffeine because my fans were nearly permanently running when I tested them on my old Dell latitude in a live session. On Zorin Lite the fans were louder, too, with the systemd-inhibit command. That surprises me, and I don't have an explanation for it.

I'm not entirely sure if that was just a coincidence or if things actually got worse (or if my laptop simply had a lot more downtime before because of the frequent video/wlan stopps and was recovering during those breaks). Still, it was really great to watch a video without the unwanted pauses.