I simply disabled sleep - if I don’t hit a key, it won’t happen… I guess if I enabled sleep it’d be 3 hours or something so that it wouldn’t happen during Plex or Radio listening without much interaction.
I agree, Caffeine sucks - it should have a timer (i.e. 2 or 3 hours of Caffeine for a click, or media detection).
With KDE it is very simple to use an Activity, make a new one called Caffeine and make that have special power settings… in Settings/Activity Power Settings I did set one for ‘bedtime’ which puts mine to sleep after 2 hours so I could leave it running and doze off.
I haven’t tested it, I’m curious of I left a radio playing there and switched to using my main Activity… if I’m not in the ‘Caffeine’ activity will the settings hold whilst something’s running in there? I don’t know.
One thing I do love to do is to use scripts bound to mouse gestures.
Here’s my PLEX one…
So I draw a PLEX sign to launch the script.
Here’s the script:
#!/bin/bash
# PULSEAUDIO
systemctl --user stop pulseaudio.socket systemctl --user stop pulseaudio.service
plexmediaplayer
sleep 5
systemctl --user start pulseaudio.service
The effect is that Pulse goes dead (i.e. volume control goes blank) and Plex uses Alsa and gets passthrough for Dolby to the receiver.
The pulseaudio.service doesn’t actually restart until AFTER Plex is killed.
You could do the same thing…
Disable:
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
Launch Plex, then re-enable it:
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
If it works for that, and you want to play a 2 hour youtube video, then you make a Youtube webapp and make a script for that.
Or just make a ‘sleep’ script which will toggle sleep and bind that to something that makes sense (maybe Alt+Pause) with a notification.
I do this with my Logi keyboard function setting and get a notification telling me if I turned them on or off:
#!/bin/bash
checkstatus=$(solaar config 1 | tail -1 | awk '{ print $3 }')
echo "$checkstatus"
if [[ "$checkstatus" == "True" ]] ; then
solaar config 1 fn-swap off && notify-send 'Functions OFF'
else
solaar config 1 fn-swap on && notify-send 'Functions ON'
fi
It’s worth figuring out, because it gives you some power. Track it down - KDE config is all in text files.