Monday, October 27, 2008

wmii and sound volume

Sound volume can be controlled by this commands:
amixer sset PCM 5%+
amixer sset PCM 5%-


Let's use ModKey+Shift+a keys for decrease and ModKey+Shift+s for increase volume.

So change wmiirc configuration file:
Configuration Variables
...
# Configuration Variables
MODKEY=Mod4
UP=k
DOWN=j
LEFT=h
RIGHT=l
SOUNDUPB=s
SOUNDDOWNB=a

...


set -- $(echo $WMII_NORMCOLORS $WMII_FOCUSCOLORS)
WMII_MENU='dmenu -b -fn "$WMII_FONT" -nf '"'$1' -nb '$2' -sf '$4' -sb '$5'"
WMII_9MENU='wmii9menu -font "$WMII_FONT" -nf '"'$1' -nb '$2' -sf '$4' -sb '$5' -br '$6'"
WMII_TERM="urxvt"
WMII_SOUNDUP="amixer sset PCM 5%+"
WMII_SOUNDDOWN="amixer sset PCM 5%-"


And in Key Binding part:
Key $MODKEY-Shift-$DOWN
wmiir xwrite /tag/sel/ctl send sel down
Key $MODKEY-Shift-$UP
wmiir xwrite /tag/sel/ctl send sel up
Key $MODKEY-Shift-$SOUNDUPB
eval $WMII_SOUNDUP &
Key $MODKEY-Shift-$SOUNDDOWNB
eval $WMII_SOUNDDOWN &
Powered by Blogger.