~yerinalexey/dotfiles

ref: 144a38b0aa0a39003633d53b77fe4e3ca29c054b dotfiles/scripts/player-menu -rwxr-xr-x 388 bytes
144a38b0Alexey Yerin river,update-volume: fix old wob crashes 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

# Select MPRIS player

current_player="$(cat /tmp/player-name)"

# Place current player at the top
players="$(playerctl -l)"
players="$(printf "%s" "$players" | sed "s|^$current_player$|-> \0|")"

selected_player="$(printf "%s" "$players" | bemenu -p "player>" -l -1)"

if [ -n "$selected_player" ]; then
	printf "%s" "$selected_player" | sed 's/^-> //g' > /tmp/player-name
fi