dmenu-scripts/dmenu-playerctl

19 lines
423 B
Plaintext
Raw Normal View History

#!/bin/sh
# script to run a menu prompt when having more than 2 players since
# playerctl is bad at managing more than one player at the same time
2022-07-17 11:03:13 +02:00
source $HOME/.config/dmenu/config
command="$@"
instances=$(playerctl -l | wc -l)
if [ "$instances" = "0" ]; then
exit
elif [ "$instances" -lt "2" ]; then
playerctl $command
else
2022-07-17 11:03:13 +02:00
choice=$(playerctl -l | $DMENU -p 'Manage:')
playerctl -p $choice $command
fi