diff options
author | zachir <zachir@librem.one> | 2023-02-27 00:14:48 -0600 |
---|---|---|
committer | zachir <zachir@librem.one> | 2023-02-27 00:14:48 -0600 |
commit | 04c0f463aa788b99b511e952a040cf0def2cb4fa (patch) | |
tree | 95e5ca7013a2f290cd545bd5ec763853c736f616 /mprisctl | |
parent | 42feda400d8fd77e460aacca9e99af70c188b7c9 (diff) |
update mprisctl to use bemenu; check for display server without flags
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 |