You are not logged in.
Pages: 1
...and I'd like to change that.
I want to prevent only sleep/hibernation which activates automatically after some idle time - not the screensaver function.
I have installed a simple wm-only system under Xorg. It works as expected otherwise. It uses xfce4-power-manager.
mpd is started through the provided systemd --user service.
I could start it with systemd-inhibit, but I want to stop the system from going to sleep only when mpd is playing something, not all the time it is up.
I have changed mpd's output from ALSA to pulse, to no avail.
I just spend ~2h searching around and found nothing satisfactory (closest was something about dBus calls which is a bit above my capabilities).
If this cannot be solved from within mpd or pulseaudio, I can write a small daemon script to check if mpd is playing something (easy), and tell systemd (?) to not go to sleep right now (???).
Any ideas?
$ grep -vE '[[:space:]]*#|^$' .config/mpd/mpd.conf
music_directory "~/Music"
playlist_directory "~/.config/mpd/playlists"
db_file "~/.config/mpd/database"
pid_file "~/.config/mpd/pid"
state_file "~/.config/mpd/state"
sticker_file "~/.config/mpd/sticker.sql"
bind_to_address "localhost"
port "6600"
restore_paused "yes"
save_absolute_paths_in_playlists "yes"
auto_update "yes"
zeroconf_enabled "no"
input_cache {
size "1 GB"
}
audio_output {
type "pulse"
name "MPD"
}Nothing exciting, locally stored music only.
TIA
Offline
idk. whether you can hook scripts out of mpd actions, but you could certainly poll mpd, see whether it's playing something and un/inhibit the S3 based on the status?
while read line; do mpc status | grep playing > /dev/null 2>&1 && echo inhibit || echo snorlax; done < <(mpc idleloop player)Offline
Yes, that's the easy part.
But how I can implement "inhibit sleep, but only until the next test"?
Offline
You can just fork a 512 day sleep save the PID and kill it when the playback stops ?
Offline
Pages: 1