👽
This commit is contained in:
1 parent
0b17aa140b
commit
dde4ef218a
136 files changed
+9796
No files matched your search
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$1" = "status" ]; then
|
||||
state=$(amixer sget Capture | grep "\[on\]")
|
||||
if [ -n "$state" ]; then
|
||||
echo "no"
|
||||
else
|
||||
echo "yes"
|
||||
fi
|
||||
elif [ "$1" = "toggle" ]; then
|
||||
state=$(amixer sget Capture | grep "\[on\]")
|
||||
if [ -n "$state" ]; then
|
||||
amixer sset Capture nocap
|
||||
echo "no"
|
||||
else
|
||||
amixer sset Capture cap
|
||||
echo "yes"
|
||||
fi
|
||||
elif [ "$1" = "set" ] && [ "$2" -gt 0 ] && [ "$2" -le 100 ]; then
|
||||
volume="$2%"
|
||||
amixer sset Capture "${volume}"
|
||||
echo "Volume set to ${volume}"
|
||||
elif [ "$1" = "get" ]; then
|
||||
(( mic_vol = $(amixer sget Capture | grep -oE '[0-9]+%' | tr -d '%') * 100 / 100 ))
|
||||
echo $mic_vol
|
||||
elif [ "$1" = "percent" ] && [ "$2" -gt 0 ] && [ "$2" -le 100 ]; then
|
||||
amixer sset Capture "${2}%"
|
||||
echo "Volume set to ${2}%"
|
||||
else
|
||||
echo "Usage: $0 [status|toggle|set|get|percent]"
|
||||
fi
|
||||
Reference in new issue
Block a user