Keyboard Shortcut for Changing Volume

Harold Aling h.aling at home.nl
Fri Feb 2 09:43:08 CET 2007


samuel verstraete wrote:
> maybe take a look at the notification daemon? you could assign both
> the amixer command and the notification command to the shortcut
>
> something like:
>
> amixer set Master 5- && notify-send -i
> /usr/share/icons/Rodent/48x48/stock/stock_volume.png "VOLUME" "`amixer
> sget Master | grep "Front Left:" | cut -d"[" -f2 | sed "s/\]//g`"
>
> something like that :p
>
>   
This is mine (used for adjusting the mono output speaker on a desktop)

Usage: volume.sh [up|down|mute]

#!/bin/bash

VOLSTEP=2
MASTER='Master Mono'
OFF_STATUS="[off]"
STATUS=`eval amixer get \'${MASTER}\',0| grep 'Mono:' | cut -d' ' -f7`

if [ "${1}" = "up" ]; then
        if [ "${STATUS}" = "${OFF_STATUS}" ]; then
                eval amixer sset \'${MASTER}\',0 unmute
                eval amixer set \'${MASTER}\',0 0
        fi
        eval amixer set \'${MASTER}\',0 ${VOLSTEP}+
fi
if [ "${1}" = "down" ]; then
        eval amixer set \'${MASTER}\',0 ${VOLSTEP}-
fi
if [ "${1}" = "mute" ]; then
        if [ "${STATUS}" != "${OFF_STATUS}" ]; then
                eval amixer sset \'${MASTER}\',0 mute
        else
                eval amixer sset \'${MASTER}\',0 unmute
        fi;
fi




More information about the Xfce mailing list