From c384ab4ee6e52da718295c5dec59488aeb3cdeba Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 29 Dec 2021 22:22:01 +0000 Subject: [PATCH] Add media controls for devices without dedicated keys Most have volume controls, so hijack those --- files/i3.conf | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/files/i3.conf b/files/i3.conf index 4cc21ed..a5f5538 100644 --- a/files/i3.conf +++ b/files/i3.conf @@ -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%