Custom keybinding didn't work


Intro

When I want to change the music volume on the main sound output use keybinding, it’s fine. However, when I want to change the volume of the music whose sound output is using bluetooth audio, it doesn’t work.

Then I found on forum sites, if I want to change the audio volume for all outputs I can use the command amixer set Master 10%+.

I try it and it in terminal, and it work. But, when I try for add my audio custom command for keybinding on config file /etc/i3/config, It doesn’t work. I don’t take any effect from change that.


What I Try

I’ve also done testing by changing:

bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status

to:

bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +20% && $refresh_i3status

Then I restart the configuration file use shortcut Mod+Shift+C. And It doesn’t make any change, my volume didn’t increase 20% when I pressed volume up.

I try to repeat the my step in up, but with different file configuration that located in $USER/.i3/config. And it doesn’t make any change too, except that red bar with text You have an error in your i3 config file! appear on my top screen.

ERROR: Duplicate keybinding in config file:
  state mask 0x0 with keysym XF86AudioRaiseVolume, command "exec --no-startup-id amixer set Master 10%- && $refresh_i3status"
ERROR: FYI: You are using i3 version 4.20.1 (2021-11-03)
ERROR: Received ConfigureNotify for unknown window 0x00600000
ERROR: Received ExposeEvent for unknown window 0x00600000
ERROR: Received ConfigureNotify for unknown window 0x00600000
ERROR: Received ConfigureNotify for unknown window 0x0060000b
ERROR: Received ExposeEvent for unknown window 0x0060000b
ERROR: Received ConfigureNotify for unknown window 0x0060000b

The Question

  1. How to add the custom audio keybinding, and are this is bug?
  2. How to make my audio keybinding shortcut can effect to all output audio?
  3. If there an another alternative, then what should I do?

Specification

Kernel version : Linux 5.18.0-1-MANJARO x86_64
Manjaro version: 21.2.6 (Qonos) 
i3 version     : 4.20.1 (2021-11-03)
Pulseaudio ver : 15.0-4

Your advice is really needed here, thank you :wave: :grin:


Don’t make edits in /etc/i3/config. User made configurations should be in ~/.config/i3/config. Also see i3 - ArchWiki.

Try Mod+Shift+R.

1 Like

I didn’t found file config on ~/.config/i3/config, but I think maybe my file config on ~/.i3/config

I try to add my custom audio bindsym on ~/.i3/config and restart i3 use Mod+Shift+R, it’s always show red bar on my top screen.
You have an error in your i3 config file!

Then I click show error:

ERROR: Duplicate keybinding in config file:
  state mask 0x0 with keysym XF86AudioRaiseVolume, command "exec --no-startup-id amixer set Master 10%- && $refresh_i3status"
ERROR: FYI: You are using i3 version 4.20.1 (2021-11-03)
ERROR: Received ConfigureNotify for unknown window 0x00600000
ERROR: Received ExposeEvent for unknown window 0x00600000
ERROR: Received ConfigureNotify for unknown window 0x00600000
ERROR: Received ConfigureNotify for unknown window 0x0060000b
ERROR: Received ExposeEvent for unknown window 0x0060000b
ERROR: Received ConfigureNotify for unknown window 0x0060000b

By the way, thanks for your response :slight_smile:

I fix this problem:

Sorry, my fault. I don’t notice that I copied the same text on ~/.i3/config:

bindsym XF86AudioRaiseVolume exec --no-startup-id amixer set Master 10%+ && $refresh_i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id amixer set Master 10%- && $refresh_i3status

I fix it by change to:

bindsym XF86AudioRaiseVolume exec --no-startup-id amixer set Master 10%+ && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id amixer set Master 10%- && $refresh_i3status

But this still didn’t fix my audio problem, I will try restart soon and tell what happened soon.


[SOLVED]

After my experimenting, I was finally able to solve this problem.

I don’t remember all of them, but I do remember some important points, I think maybe this is bug or whatever. I didn’t rebooting


What I am do:

  1. I open ~/.i3/config

  2. Then I add this line:

# Custom audio
bindsym XF86AudioRaiseVolume exec --no-startup-id amixer set Master 10%+ && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id amixer set Master 10%- && $refresh_i3status
  1. Reload (Mod+Shift+R)

  2. Still didn’t works, Try experiment by change the line into:

# Custom audio
bindsym XF86AudioRaiseVolume exec notify-send 'Hello+'
bindsym XF86AudioLowerVolume exec notify-send 'Hello-'
  1. And the magic, it works. Each volume button give the right output (Press Volume Up button, that will show Hello+ notification, and same like Volume Down button Hello-)

  2. Know that button still works like my experiment before, I instantly changed the ~/.i3/config again by change into:

# Custom audio
bindsym XF86AudioRaiseVolume exec --no-startup-id amixer set Master 10%+ && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id amixer set Master 10%- && $refresh_i3status
  1. IT WORKS, but knowing that command $refresh_i3status didn’t print change volume notification, so I decided to deleted it. Maybe you have a suggestion, The alternative audio change notification instead of %refresh_i3status.

Thanks to everyone, who has tried to help me again :grin::grin:

If I have a bad word or language, please correct me :pray:


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.