dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles # fast
git clone https://src.adamsgaard.dk/dotfiles.git # slow
Log | Files | Refs | README | LICENSE Back to index

commit b4a4ceaf743d5e328ef69e93ed17fad6fc939ec6
parent bc2a390313ab76df6e5e6ba62fec85bc1d51ca3a
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Thu, 28 Jan 2021 12:55:45 +0100

screenrecord: change audio source based on platform

Diffstat:
M.local/bin/screenrecord | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.local/bin/screenrecord b/.local/bin/screenrecord @@ -7,7 +7,12 @@ startrecording() { fname="screenrecord-$(date '+%Y-%m-%d_%H:%M:%S')" out="$HOME/tmp/${fname}.mkv" - sndioctl -q input.level=1.0 + if test -x /usr/bin/sndioctl; then + sndioctl -q input.level=1.0 + snddrv="sndio" + else + snddrv="alsa" + fi if test "$(xdpyinfo | awk '/dimensions/ {sub(/.*x/, "", $2); print $2}')" -gt 1500; then xrandr --output "$screen" --mode 1920x1080 @@ -24,7 +29,7 @@ startrecording() { -s "$(xdpyinfo | awk '/dimensions/ {print $2}')" \ -i $DISPLAY \ -thread_queue_size 2048 \ - -f sndio -i default \ + -f "$snddrv" -i default \ -r 30 \ -c:v libx264rgb -crf 0 -preset ultrafast -c:a flac \ "$out" >/dev/null 2>&1 &