diff options
Diffstat (limited to 'mprisctl')
-rwxr-xr-x | mprisctl | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -6,18 +6,27 @@ printhelp () { while getopts "hwxd:" o; do case "${o}" in w) - DMENU="tofi" - DEFARGS="--prompt-text" + DMENU="bemenu" ;; x) DMENU="dmenu" - DEFARGS="-p" ;; d) ARGS="$ARGS$OPTARG " ;; *) printhelp ;; esac done -DMENU_PROMPT=$(playerctl -l | $DMENU $ARGS $DEFARGS 'Players:') +if [ -z "$DMENU" ]; then + if [ -n "$WAYLAND_DISPLAY" ]; then + DMENU="bemenu" + elif [ -n "$DISPLAY" ]; then + DMENU="dmenu" + else + printf "Can't tell if Wayland or X; what gives?\n" + exit 1 + fi +fi + +DMENU_PROMPT=$(playerctl -l | $DMENU $ARGS -p 'Players:') [ -z "$DMENU_PROMPT" ] && exit 1 PLAYERCONTROLS_PROMPT=$(echo "play-pause |