mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-26 19:58:35 +02:00
32 lines
1.2 KiB
Text
32 lines
1.2 KiB
Text
|
#!/bin/sh
|
||
|
|
||
|
# Media player menu with rofi
|
||
|
|
||
|
choice=$(
|
||
|
{
|
||
|
printf "Previous track\00icon\37go-previous\n"
|
||
|
printf "Play\00icon\37media-playback-start\n"
|
||
|
printf "Pause\00icon\37media-playback-pause\n"
|
||
|
printf "Stop\00icon\37media-playback-stop\n"
|
||
|
printf "Next track\00icon\37go-next\n"
|
||
|
printf "Open mixer panel\00icon\37multimedia-volume-control\n"
|
||
|
printf "Show Spotify\00icon\37com.spotify.Client\n"
|
||
|
} | rofi -dmenu -show-icons -no-custom -i -p "media player action" \
|
||
|
-kb-select-1 Super+z \
|
||
|
-kb-select-2 Super+x \
|
||
|
-kb-select-3 Super+c \
|
||
|
-kb-select-4 Super+v \
|
||
|
-kb-select-5 Super+b \
|
||
|
-kb-select-6 Super+m \
|
||
|
-kb-select-7 Super+s \
|
||
|
)
|
||
|
case $choice in
|
||
|
Previous*) xdotool key --clearmodifiers XF86AudioPrev ;;
|
||
|
Next*) xdotool key --clearmodifiers XF86AudioNext ;;
|
||
|
Play) xdotool key --clearmodifiers XF86AudioPlay ;;
|
||
|
Pause) xdotool key --clearmodifiers XF86AudioPause ;;
|
||
|
Stop) xdotool key --clearmodifiers XF86AudioStop ;;
|
||
|
Open*) i3-msg exec exec pavucontrol ;;
|
||
|
*Spotify*) i3-msg '[class="Spotify"] focus' || i3-msg exec exec spotify ;;
|
||
|
esac
|