diff options
author | Patrick Spek <p.spek@tyil.nl> | 2021-03-18 09:37:23 +0100 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2021-08-14 12:01:17 +0200 |
commit | 4fbab1b6c91581f8b82e7a767d30fb5c5857eaf1 (patch) | |
tree | 932147d7f64f05cfa0e51139494ecabfcd944f8c | |
parent | f002870d12ccc58e9b2177250df684cb5aa49fd9 (diff) |
Alter mpc interaction in xblank
-rwxr-xr-x | .config/xblank/active | 8 | ||||
-rwxr-xr-x | .config/xblank/idle_150 | 9 |
2 files changed, 16 insertions, 1 deletions
diff --git a/.config/xblank/active b/.config/xblank/active index 8600831..f66f41a 100755 --- a/.config/xblank/active +++ b/.config/xblank/active @@ -1,3 +1,11 @@ #!/bin/sh +# Resume mpd if it was paused through an xblank script +if [ -f "$XBLANK_STATESD/mpd" ] +then + rm -f -- "$XBLANK_STATESD/mpd" + + mpc play +fi + xset dpms force on diff --git a/.config/xblank/idle_150 b/.config/xblank/idle_150 index 0e250bb..0994761 100755 --- a/.config/xblank/idle_150 +++ b/.config/xblank/idle_150 @@ -1,3 +1,10 @@ #!/bin/sh -physlock +# Pause mpd if its playing +if mpc | head -n 2 | tail -n 1 | grep -Fq '[playing]' +then + mpc pause + touch "$XBLANK_STATESD/mpd" +fi + +xset dpms force off |