You are not logged in.

#1 2011-06-08 13:46:33

MikeZuluBravo
Member
Registered: 2011-06-08
Posts: 3

Problem with adjusting sound using special keys in Xfce

I have programmed my keyboard using xmodmap so that some dedicated keys on the keyboard are mapped to audio control functions; here is the .Xmodmap file:

keycode 113 = XF86AudioMute
keycode 114 = XF86AudioLowerVolume
keycode 115 = XF86AudioRaiseVolume
keycode 227 = XF86Display
keycode 112 = XF86MonBrightnessDown
keycode 118 = XF86MonBrightnessUp
keycode 142 = XF86Standby

I run xmodmap in my .xinitrc file before starting Xfce, and I can see the configuration is taking effect because when I create a keyboard application shortcut in Xfce, the keysym I press is listed correctly by name.

I'm using ALSA for the sound driver. All current Arch updates are applied.

In the Xfce Keyboard configuration utility I am creating a keyboard shortcut to map XF86AudioMute to "amixer set Master toggle". However, when I actually press the dedicated key, the sound is not muted.

I've tried running "amixer set Master toggle" from a command line and it has the expected effect, but nothing happens when pressing the dedicated key. I've created similar shortcuts to raise or lower the volume, and the same problem exists when pressing the "Volume Up " and "Volume Down" keys.

On the assumption that it may be a path problem, I've tried setting the command to "/usr/bin/amixer set Master toggle" but that made no difference.

On the assumption that it may be a permission problem, I've tried making the same change when logged in as root, but that made no difference either.

Some functions configured in the Xfce Keyboard configuration utility do appear to work when I press the relevant special key; it's just the audio functions which don't seem to work.

Any suggestions?

Thanks in advance,
Michael

Offline

#2 2011-06-08 14:15:39

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,265

Re: Problem with adjusting sound using special keys in Xfce

Try searching the wiki for xbindkeys. You can look at my configs to see how I do it ( it should be similar). And remember to add xbindkeys to your ~/.xinitrc also.

Offline

#3 2011-06-08 15:14:25

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Problem with adjusting sound using special keys in Xfce

Looks like some useful hints here.

Although personally, I use xbindkeys:

"/usr/bin/amixer -q sset Master 2+"
    Control+Shift + Up
"/usr/bin/amixer -q sset Master 2-"
    Control+Shift + Down

Offline

#4 2011-06-08 16:22:12

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,694

Re: Problem with adjusting sound using special keys in Xfce

I had xmodmap stop working for me and took the path of least resistance by switching to xbindkeys.  When I was using xfce4 exclusively, I just used the xfce4 services for keyboard shortcuts and they worked perfectly.  You might just go to the settings menu->keyboard and map key presses to actions there.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#5 2011-06-09 03:41:26

MikeZuluBravo
Member
Registered: 2011-06-08
Posts: 3

Re: Problem with adjusting sound using special keys in Xfce

ewaller wrote:

When I was using xfce4 exclusively, I just used the xfce4 services for keyboard shortcuts and they worked perfectly.  You might just go to the settings menu->keyboard and map key presses to actions there.

That's what I'm doing, and that's what's not working  8-)

It looks like xbindkeys is the way to go.

Thanks all for your comments and assistance.

Cheerio, Michael

Offline

Board footer

Powered by FluxBB