dots

Personal dotfiles
git clone git://git.gormless.xyz/dots.git
Log | Files | Refs

mute (450B)


      1 #!/bin/sh
      2 
      3 mute_mic() {
      4 	sndioctl input.mute=!
      5 	state="$(sndioctl input.mute)"
      6 	test $state = "input.mute=0" && notify-send "Mic unmuted." || notify-send "Mic muted."
      7 }
      8 
      9 mute_sound() {
     10 	sndioctl output.mute=!
     11 	state="$(sndioctl output.mute)"
     12 	test $state = "output.mute=0" && notify-send "Audio unmuted." || notify-send "Audio muted."
     13 }
     14 
     15 usage() {
     16 	echo usage: mute [-m] [-s]
     17 }
     18 
     19 case $@ in
     20 	-m)
     21 		mute_mic ;;
     22 	-s)
     23 		mute_sound ;;
     24 	*)
     25 		usage ;;
     26 esac