mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-25 13:24:35 +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
|
13
config
13
config
|
@ -31,18 +31,7 @@ bindsym XF86AudioPause exec --no-startup-id exec playerctl -p $mediaplayer
|
|||
bindsym XF86AudioStop exec --no-startup-id exec playerctl -p $mediaplayer stop
|
||||
bindsym XF86AudioNext exec --no-startup-id exec playerctl -p $mediaplayer next
|
||||
bindsym XF86AudioPrev exec --no-startup-id exec playerctl -p $mediaplayer previous
|
||||
mode "mediaplayer" {
|
||||
bindsym "z" exec --no-startup-id exec playerctl -p $mediaplayer previous; mode "default"
|
||||
bindsym "x" exec --no-startup-id exec playerctl -p $mediaplayer play-pause; mode "default"
|
||||
bindsym "c" exec --no-startup-id exec playerctl -p $mediaplayer pause; mode "default"
|
||||
bindsym "v" exec --no-startup-id exec playerctl -p $mediaplayer stop; mode "default"
|
||||
bindsym "b" exec --no-startup-id exec playerctl -p $mediaplayer next; mode "default"
|
||||
bindsym "m" exec exec pavucontrol; mode "default"
|
||||
bindsym "s" [class="(?i)$mediaplayer"] focus; mode "default"
|
||||
bindsym Escape mode "default"
|
||||
bindsym Return mode "default"
|
||||
}
|
||||
bindsym $mod+s mode "mediaplayer"
|
||||
bindsym $mod+s exec --no-startup-id exec ~/.config/i3/bin/rofi-mediaplayer
|
||||
|
||||
# Brightness
|
||||
bindsym XF86MonBrightnessUp exec --no-startup-id exec brightnessctl set +5%
|
||||
|
|
|
@ -23,10 +23,9 @@ configuration {
|
|||
mangenta: #d886f3;
|
||||
cyan: #6cdcf7;
|
||||
emphasis: #50536b;
|
||||
text: #dfdfdf;
|
||||
text-alt: #b2b2b2;
|
||||
fg: #abb2bf;
|
||||
bg: #282c34cc;
|
||||
text: #efefef;
|
||||
text-alt: #c2c2c2;
|
||||
bg: #282c34ee;
|
||||
|
||||
spacing: 0;
|
||||
background-color: transparent;
|
||||
|
@ -76,6 +75,7 @@ element {
|
|||
}
|
||||
element-icon {
|
||||
size: 1em;
|
||||
padding: 0 0.5em 0 0;
|
||||
}
|
||||
|
||||
element selected {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue