You are not logged in.

#1 2011-12-11 19:33:35

emdonahu
Member
Registered: 2011-12-11
Posts: 12

[SOLVED] Thinkpad Volume Controls

Hi, new to arch and loving it so far. I am having one minor issue though: I can't get the volume controls to work in xfce. I've got a new Thinkpad T520 with windows and arch.

Mute worked out of the box, and I have checked with xev that my volume keys (keycode 122, 123) fire XF86AudioLowerVolume and XF86AudioRaiseVolume respectively, but these do not seem to change the volume at all. I have tried setting new keyboard shortcuts, but for some reason the keyboard shortcut window is extremely buggy for me and lets me enter commands but not actual shortcut keys for those commands, near as I can tell. I'm not quite sure which direction to investigate at the moment. Any input appreciated.

Last edited by emdonahu (2011-12-14 00:37:23)

Offline

#2 2011-12-11 19:45:49

kurych
Member
From: Saint-Petersburg, Russia
Registered: 2011-12-07
Posts: 27

Re: [SOLVED] Thinkpad Volume Controls

If you use alsa, try make bind to volume keys such script:

$cat /usr/local/bin/volime-ctl

#!/bin/sh
#
MUTE="off"
if [ 'X'$1 == 'Xmute' ]; then
    amixer -q set Master off
    MUTE="on"
else
    LEVEL=`cat /proc/acpi/ibm/volume | awk '/^level:/ {print $2}'`
    VOLUME=`perl -e "printf (\"%2.0f\n\", $LEVEL/15*100);"`
fi

if [ $MUTE == 'on' ]; then
    INFO=MUTED
    ICON=audio-volume-muted
else
    if [ $VOLUME -eq 0 ]; then
        ICON=audio-volume-off
    elif [ $VOLUME -lt 33 ]; then
        ICON=audio-volume-low
    elif [ $VOLUME -lt 66 ]; then
        ICON=audio-volume-medium
    else
        ICON=audio-volume-high
    fi
    VOLUME="${VOLUME}%"
    amixer -q sset Master $VOLUME on
fi
/usr/bin/notify-send --expire-time=2000 "Volume Control" "$VOLUME" -i $ICON

Many interesting you could found at http://www.thinkwiki.org/wiki/ThinkWiki

Last edited by kurych (2011-12-11 19:59:11)

Offline

#3 2011-12-12 00:57:03

emdonahu
Member
Registered: 2011-12-11
Posts: 12

Re: [SOLVED] Thinkpad Volume Controls

Hey, should that be volume-ctl? Also, I'm not quite sure how that script is going to be used. Is that something alsa will know to look for?

Offline

#4 2011-12-12 02:25:19

jon
Member
Registered: 2002-11-28
Posts: 87

Re: [SOLVED] Thinkpad Volume Controls

If you are using Xfce, forget messing with scripts and key-bindings and amixer, and install xfce4-volumed from the AUR and gstreamer0.10-base-plugins. No configuration is necessary, xfce4-volumed starts with Xfce automatically.

Log out & log back in, and Xfce will handle your volume & mute keys like a thing of beauty.  It even integrates with the on-screen notification system.

Offline

#5 2011-12-12 09:31:18

kurych
Member
From: Saint-Petersburg, Russia
Registered: 2011-12-07
Posts: 27

Re: [SOLVED] Thinkpad Volume Controls

Forget about my script. Jon offered a better idea. I did not know about it, because I am older than this package. ;-)

Offline

#6 2011-12-14 00:36:35

emdonahu
Member
Registered: 2011-12-11
Posts: 12

Re: [SOLVED] Thinkpad Volume Controls

Shazam. Thanks. Worked.

Offline

Board footer

Powered by FluxBB