summaryrefslogtreecommitdiff
path: root/mprisctl
diff options
context:
space:
mode:
Diffstat (limited to 'mprisctl')
-rwxr-xr-xmprisctl17
1 files changed, 13 insertions, 4 deletions
diff --git a/mprisctl b/mprisctl
index f63bb59..0685de7 100755
--- a/mprisctl
+++ b/mprisctl
@@ -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