Add media controls for devices without dedicated keys

Most have volume controls, so hijack those
This commit is contained in:
Jake Howard 2021-12-29 22:22:01 +00:00
parent 53d46ff2b5
commit c384ab4ee6
Signed by: jake
GPG Key ID: 57AFB45680EDD477
1 changed files with 12 additions and 4 deletions

View File

@ -24,13 +24,21 @@ bindsym $mod+Shift+r restart
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
# Media Controls
set $playerctl playerctl -i firefox # ignore firefox when doing media control
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl -- set-sink-volume @DEFAULT_SINK@ +2% #increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id pactl -- set-sink-volume @DEFAULT_SINK@ -2% #decrease sound volume
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle # mute sound
bindsym XF86AudioPause exec playerctl play-pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
bindsym $mod+XF86AudioMute exec --no-startup-id amixer set Capture toggle && amixer get Capture | grep '\[off\]' && notify-send "🎙 MIC OFF" || notify-send "🎙 MIC ON" # mute mic
bindsym XF86AudioPause exec $aplayerctl play-pause
bindsym XF86AudioNext exec $aplayerctl next
bindsym XF86AudioPrev exec $aplayerctl previous
bindsym $mod+Shift+XF86AudioMute exec --no-startup-id amixer set Capture toggle && amixer get Capture | grep '\[off\]' && notify-send "🎙 MIC OFF" || notify-send "🎙 MIC ON" # mute mic
# Some of my devices don't have full media controls
bindsym $mod+XF86AudioMute exec $aplayerctl play-pause
bindsym $mod+XF86AudioRaiseVolume exec $aplayerctl next
bindsym $mod+XF86AudioLowerVolume exec $aplayerctl previous
# Brightness
bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl s +5%