mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-08-04 02:04:30 +02:00
i3: replace media player mode by rofi
This commit is contained in:
parent
110db5aa34
commit
99de0bc1fd
3 changed files with 36 additions and 16 deletions
31
bin/rofi-mediaplayer
Executable file
31
bin/rofi-mediaplayer
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/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
|
Loading…
Add table
Add a link
Reference in a new issue