#!/bin/sh wrap_before() { if command -v mpc > /dev/null && mpc status | awk 'NR==2 { print }' | grep -iq playing then wrap_log "> mpc pause" mpc pause > /dev/null WRAPPER_X_MPD_PAUSED="yes" fi if [ "$(cat "$XDG_RUNTIME_DIR/xblank/paused")" = "0" ] then wrap_log "> xblank-toggle" xblank-toggle WRAPPER_X_XBLANK_PAUSED="yes" fi } wrap_after() { if [ "$WRAPPER_X_MPD_PAUSED" ] then wrap_log "> mpc play" mpc play > /dev/null fi if [ "$WRAPPER_X_XBLANK_PAUSED" ] then wrap_log "> xblank-toggle" xblank-toggle fi }