#! /bin/bash # (c) 2005 Sune Vuorela # Version 0.9 # # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): # wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you # think this stuff is worth it, you can buy me a beer in return. # Sune Vuorela # ---------------------------------------------------------------------------- # # Original beerware license is due to Poul-Henning Kamp. if [ $1 = "up" -o $1 = "down" ]; then KOMMANDO=$(amixer cget numid=2|grep values) VOLUMEN=${KOMMANDO##*,} if [ $1 = "up" -a $VOLUMEN -lt 31 ]; then ((VOLUMEN += 1 )) else if [ $1 = "down" -a $VOLUMEN -gt 0 ]; then ((VOLUMEN -=1)) fi fi amixer -q cset numid=2 $VOLUMEN else if [ $1 = "onoff" ]; then KOMMANDO=$(amixer cget numid=1|grep values) VALUE=${KOMMANDO##*=} if [ $VALUE = "on" ]; then SET="off" else SET="on" fi amixer -q cset numid=1 $SET fi fi