Last night, I was able to watch a video without interruptions
I tested these commands (just one at a time)
systemd-inhibit --what=idle:sleep --why=video --mode=block sleep 2h
while true; do xdotool mousemove_relative -- 0 0; sleep 60;
done
The second one seems to need more ressources (fans were louder - or my laptop was hot because it was the second test. I could set a time which is a bit less than the 15 minutes of autosuspend).
In a shorter test of 20min the keep-alive tool has worked, too. But I prefer a solution without external third-party tools from internet.
Personally, I'm not a big fan of fiddling with the slider in Xfce4 Power Manager each day (I don't like to have to hit the pixel for a special value as e.g. 15 with the touchpad), so the first command could be an option for me and I could keep the normal autosuspend settings for my daily work when not watching videos.
I'm not quite sure what caused my problem with the network manager falling asleep and which are the
corresponding terminal commands as setting "never" in xfce4 power manager.
Often is given the advice to set
xset s off -dpms
and I'm not sure if that command affects the same things as the systemd-inhibit command (or only the screensaver and display). I read, dbus can prevent sleep, too. So, I'm interested which commands are used in xfce4 power manager when you turn on/off stuff there or set times for system and display.
Is it true that the systemd-inhibit command remains active as long as the terminal is opened and terminates when the terminal is closed?
Here I found a guide which adds sh & disown to the command to run it in background:
Because my old laptop is reaching its limits when playing videos (heat!) I try to find a solution which reduces as much ressources as possible. Usually, I have only opened one browser tab with the video and not other windows.
My question is:
Can I start the systemd-inhibit command in the evening before I watch the video, close the terminal window and at the end, click on the power button to shutdown?
Or is this method complicated if I want to stop the inhibition and go into suspend, e.g. because I want to make a longer pause or want to keep my session for the next day?