#!/bin/bash # Copyright (C) 2014 Julien Bonjean # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . CARD="${1:-0}" MIXER="${2:-default}" # use pulse for pulseaudio, default is alsa SCONTROL="${3:-Master}" case $BLOCK_BUTTON in 3) amixer -D pulse set Master 1+ toggle > /dev/null ;; # right click, mute/unmute 4) amixer -q sset $SCONTROL 5%+ ;; # scroll up, increase 5) amixer -q sset $SCONTROL 5%- ;; # scroll down, decrease esac volume () { if [ `amixer sget Master | grep -o '\[off\]'` ]; then echo "MUTED" else awk -F"[][]" '/dB/ { print $2 }' <(amixer sget Master) fi } echo `volume` echo echo "#348588"