same old problem with KMix...

Andreas Neumaier andreas.neumaier at online.de
Sat Oct 21 16:16:28 BST 2006


> Thanks for the reply!
You're welcome (keine Ursache)

> I've disabled kmilo. Now when I press the VOL+, LOV- buttons nothing
> happens.
> Note: PLAY/PAUSE, STOP, FORWARD, REWIND buttons still work with Amarok...

First enable kmilod again - since KDE 3.4 or 3.5 the programmers improved this 
daemon so far that even I don't want to miss the features anym more. :-)

Now let's get XF86AudioRaiseVolume and XF86AudioLowerVolume "renamed". You 
need to remap the keys with xmodmap. Create in ~/bin a script named 
autorun.sh, make it executable, create a shortcut in the hidden KDE autorun 
directory (sorry, I have the german version running, so I only tell the 
german name of the directory: ~/.kde/Autostart) OR edit an existing startup 
script (then insert only the last of the 3 following lines):
#!/bin/bash
#
/usr/X11R6/bin/xmodmap ~/.keyboardrc

create a hidden file in ~ named .keyboardrc and fill in:
keycode 174 = F18
keycode 176 = F19

To check if everthing is working fine by now, execute in a terminal or 
konsole:
/usr/X11R6/bin/xmodmap ~/.keyboardrc

Then run xev, press the keys [Vol+] and [Vol-]. You should see the output:
...
KeyRelease event, serial 31, synthetic NO, window 0x2e00001,
    root 0x4c, subw 0x0, time 1471174660, (685,-187), root:(689,608),
    state 0x0, keycode 176 (keysym 0x1008ff13, F19), 
same_screen YES,
...

Remember your posting? XF86AudioRaiseVolume should have changed to F19, 
XF86AudioLowerVolume should have changed to F18. If that happens, you can 
install following scripts in ~/bin and bind them with KControl, Regional & 
Accessibility, Keyboard shortcuts to the scripts.

script for volume up (8 lines):
#!/bin/bash
#
lv=$(($(dcop kmix Mixer0 volume 0)+5))
dcop kmix Mixer0 setVolume 0 $lv
dcop kded kmilod displayProgress MainVolume $lv
# kdialog --passivepopup "Volume:  $lv" 1
# either use dcop kded ... or kdialog for volume output
# with kdialog last number is time in seconds for popup window

script for volume down (8 lines):
#!/bin/bash
#
lv=$(($(dcop kmix Mixer0 volume 0)-5))
dcop kmix Mixer0 setVolume 0 $lv
dcop kded kmilod displayProgress MainVolume $lv
# kdialog --passivepopup "Volume:  $lv" 1
# either use dcop kded ... or kdialog for volume output 
# with kdialog last number is time in seconds for popup window

last a script for mute (10 lines):
#!/bin/bash
#
dcop kmix Mixer0 toggleMute 0
# lv=$(dcop kmix Mixer0 mute 0)
if [ "$(dcop kmix Mixer0 mute 0)" = "true" ]
then
	dcop kded kmilod displayText "Stummgeschaltet"
else
	dcop kded kmilod displayProgress MainVolume $(dcop kmix Mixer0 absoluteVolume 
0)
fi

Don't forget to bind the script with khotkeys...

cu/2, Andreas
___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.




More information about the kde mailing list