[misc] set initial microphone volume

This commit is contained in:
Klesh Wong 2020-12-14 00:19:13 +08:00
parent 2fd90eedb5
commit 861e266cf7

24
bin/sc
View File

@ -17,6 +17,8 @@ function _start -a x y w h fps
exit 1
end
set outfile "$HOME/recording/screencast-"(date '+%y%m%d-%H%M-%S')".mp4"
touch /tmp/recording.pid
sleep 1
ffmpeg \
-f x11grab -s $w'x'$h -i "$DISPLAY+$x,$y" \
-f alsa -i default \
@ -115,6 +117,8 @@ function desktop -a fps
echo 'unable to find geometry of the first monitor'
exit 1
end
#micvol 15000
pacmd set-source-volume noechosource 52000
_start $m[4] $m[5] $m[2] $m[3] $fps
end
@ -150,6 +154,26 @@ function cover -a infile text gravity outfile
$outfile
end
set --append subcmds keep_mic_vol
function keep_mic_vol -a volume
while true
pacmd set-source-volume noechosource $volume
sleep 0.1
end
end
set --append subcmds micvol
set micvol_help '<volume>' '0~65535'
function micvol -a volume
set kmvpid (ps aux | grep ' keep_mic_vol ' | head -n -1 | awk '{print $2}')
if test -n "$kmvpid"
echo killing $kmvpid
kill $kmvpid
end
set sc (status filename)
$sc keep_mic_vol $volume &
end
set --append subcmds help
set help_help '[subcmd]' 'print this menu'
function help -a subcmd