From bc516b04f9389b3911b7b474e856a5dc200fa81d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolphe=20Br=C3=A9ard?= Date: Fri, 15 Jul 2022 13:43:54 +0200 Subject: [PATCH] Bind the media keys to a specific media player That's kind of how it used to work before the forced use of MPRIS. Without this change, only the latest used media player will receive the signal, which mean that, when I open a video on Firefox, the play-pause signal will be sent to Firefox and will therefore pause the video instead of the music I was listening to with Rythmbox. --- .config/i3/config | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.config/i3/config b/.config/i3/config index fa53950..452ec29 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -10,6 +10,7 @@ # Please see http://i3wm.org/docs/userguide.html for a complete reference! set $mod Mod4 +set $media_player rhythmbox # Font for window titles. Will also be used by the bar unless a different font # is used in the bar {} block below. @@ -150,10 +151,11 @@ bindsym Print exec scrot -e 'mv $f ~/pictures/ 2>/dev/null' bindsym $mod+l exec 'lock' # Media player controls -bindsym XF86AudioPlay exec playerctl play-pause -bindsym XF86AudioPause exec playerctl play-pause -bindsym XF86AudioNext exec playerctl next -bindsym XF86AudioPrev exec playerctl previous + +bindsym XF86AudioPlay exec playerctl --player $media_player play-pause +bindsym XF86AudioPause exec playerctl --player $media_player play-pause +bindsym XF86AudioNext exec playerctl --player $media_player next +bindsym XF86AudioPrev exec playerctl --player $media_player previous # Start i3bar to display a workspace bar (plus the system information i3status # finds out, if available)