X-Git-Url: https://disinclined.org/git/?a=blobdiff_plain;f=scripts%2Fvolume-toggle;fp=scripts%2Fvolume-toggle;h=407bf01615005555942bb27c09c572ecafeb829f;hb=2abe12bf0cc031e27307624049be2dd35ba620ac;hp=0000000000000000000000000000000000000000;hpb=080cee31584ef0ab4133fea80520422c11f68ae5;p=powermate.git diff --git a/scripts/volume-toggle b/scripts/volume-toggle new file mode 100755 index 0000000..407bf01 --- /dev/null +++ b/scripts/volume-toggle @@ -0,0 +1,12 @@ +#!/bin/bash + +export DISPLAY=:0 +status=$(amixer get Master | tail -n1 | awk '{print $NF}') +status=$(echo "${status%]}") +status=$(echo "${status#[}") +if [ $status == "on" ] + then notify-send -i /usr/share/icons/powermate/volume-on.png " " +elif [ $status == "off" ] + then notify-send -i /usr/share/icons/powermate/volume-mute.png " " +fi +amixer set Master toggle