[SOLVED] control i3wm sound

Everything about X, Gnome, KDE, ... and everything running on it

[SOLVED] control i3wm sound

Postby shogun1234 » 2017-03-25 21:30

I started to use i3wm a while ago. Adding the following lines to .config/i3/config file according to http://jackmorrison.me/2014/11/12/from- ... -i3wm.html

Code: Select all
bindsym XF86AudioRaiseVolume exec amixer -q -D set Master 2dB+ unmute
bindsym XF86AudioLowerVolume exec amixer -q -D set Master 2dB- unmute
bindsym XF86AudioMute exec amixer -q -D pulse set Master toggle


But pressing fn + f1 (mute), fn + f2 (lower sound), or fn + f3 (raise sound) doesn't work at all. These function works correctly in gnome environment. What else should I configure or check to get it worked like that in gnome environment?
Last edited by shogun1234 on 2017-03-26 15:03, edited 1 time in total.
shogun1234
 
Posts: 78
Joined: 2006-07-13 08:04

Re: control i3wm sound

Postby debiman » 2017-03-25 21:32

please find out what codes the desired key use by entering 'xev' in a terminal, then trying out those keys, then edit your config accordingly.
User avatar
debiman
 
Posts: 1086
Joined: 2013-03-12 07:18

Re: control i3wm sound

Postby shogun1234 » 2017-03-26 13:00

1 .Finding the key code
2. paste the related command to .config/i3.conf
3. reload config or logout/ login (I tried both)
4. pressing f1, f2, f3
Unfortunately it still doesn't work. Running command in console (e.g. amixer -q set Master ...) takes effect. But pressing hot key just don't work. Where can I check the problem?

Keycode
F1 keycode
Code: Select all
KeyPress event, serial 32, synthetic NO, window 0x1c00001,
    root 0xb6, subw 0x0, time 11305877, (-258,457), root:(386,477),
    state 0x0, keycode 67 (keysym 0xffbe, F1), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 32, synthetic NO, window 0x1c00001,
    root 0xb6, subw 0x0, time 11306021, (-258,457), root:(386,477),
    state 0x0, keycode 67 (keysym 0xffbe, F1), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False




F2 keycode
Code: Select all
KeyPress event, serial 32, synthetic NO, window 0x1c00001,
    root 0xb6, subw 0x0, time 11307081, (-258,457), root:(386,477),
    state 0x0, keycode 68 (keysym 0xffbf, F2), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 32, synthetic NO, window 0x1c00001,
    root 0xb6, subw 0x0, time 11307214, (-258,457), root:(386,477),
    state 0x0, keycode 68 (keysym 0xffbf, F2), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False


f3 keycode
Code: Select all
KeyPress event, serial 32, synthetic NO, window 0x1c00001,
    root 0xb6, subw 0x0, time 11308294, (-258,457), root:(386,477),
    state 0x0, keycode 69 (keysym 0xffc0, F3), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 32, synthetic NO, window 0x1c00001,
    root 0xb6, subw 0x0, time 11308436, (-258,457), root:(386,477),
    state 0x0, keycode 69 (keysym 0xffc0, F3), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False


Configuration
Code: Select all
bindsym XF86AudioRaiseVolume exec amixer -q set Master 2dB+ unmute
bindsym XF86AudioLowerVolume exec amixer -q set Master 2dB- unmute
bindsym XF86AudioMute exec amixer -q -D pulse set Master toggle
shogun1234
 
Posts: 78
Joined: 2006-07-13 08:04

Re: control i3wm sound

Postby shogun1234 » 2017-03-26 15:02

Just find a workaround. Instead of using bindsym, bind code using bindcode. And digit number 67, 68, 69 is the keycode found in 'xev' command.

Code: Select all
bindcode 69 exec amixer -q set Master 2dB+ unmute
bindcode 68 exec amixer -q set Master 2dB- unmute
bindcode 67 exec amixer -q -D pulse set Master toggle
shogun1234
 
Posts: 78
Joined: 2006-07-13 08:04

Re: [SOLVED] control i3wm sound

Postby debiman » 2017-03-27 17:18

that is not a workaround, that is a solution!
congratulations.
User avatar
debiman
 
Posts: 1086
Joined: 2013-03-12 07:18


Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable