aboutsummaryrefslogtreecommitdiff
path: root/scripts/sound.sh
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2020-12-24 00:06:27 +0530
committerAkshay Nair <phenax5@gmail.com>2020-12-24 00:06:27 +0530
commit865728068c965e066d0f8971c5b5ba26e12e7dce (patch)
treec16195f0a04cf7d004fe5b396255734f4d60bb00 /scripts/sound.sh
parent649ef5f225039e498358c3d056dfd7fcbc56f014 (diff)
downloadnixos-config-865728068c965e066d0f8971c5b5ba26e12e7dce.tar.gz
nixos-config-865728068c965e066d0f8971c5b5ba26e12e7dce.zip
Adds scripts and links scripts and wallpapers
Diffstat (limited to '')
-rwxr-xr-xscripts/sound.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/sound.sh b/scripts/sound.sh
new file mode 100755
index 0000000..090a805
--- /dev/null
+++ b/scripts/sound.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+
+mic_keep_on() {
+ while true; do
+ local audio_state=$(amixer get Capture | awk "/: Capture.*\[/ {print \$7}" | head -n 1);
+ [[ "$audio_state" != "[on]" ]] && amixer set Capture cap;
+ sleep 1;
+ done;
+}
+
+case "$1" in
+ mute-mic) amixer set Capture toggle ;;
+ mic-keep-on) mic_keep_on ;;
+ mic-vol) case "$2" in
+ up) amixer sset 'Mic Boost' '1%+' && amixer sset 'Internal Mic Boost' '1%+' ;;
+ down) amixer sset 'Mic Boost' '1%-' && amixer sset 'Internal Mic Boost' '1%-' ;;
+ full) amixer sset 'Mic Boost' '100%' && amixer sset 'Internal Mic Boost' '100%' ;;
+ esac ;;
+
+ mute) amixer set Master toggle ;;
+ volume) case "$2" in
+ up) amixer sset Master '5%+' ;;
+ down) amixer sset Master '5%-' ;;
+ esac ;;
+ *) echo "Wrong command" ;;
+esac
+
+#~/scripts/statusbar/statusbar.sh update volume;
+update-dwmblock volume;