diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2021-01-10 04:53:30 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2021-01-10 04:53:30 +0300 |
commit | 1519d69d7fb785d35d50afb64cf9f0e91da03c79 (patch) | |
tree | 9b152e56a4de3f022d6031c29d1591193ebcf202 /dotfiles/.local/bin | |
parent | 56378af36068d4f214299bc31c62d84928c921f5 (diff) | |
parent | 8238771a166cd5cdbeb02d67b8552999e2a53486 (diff) | |
download | swayrice-1519d69d7fb785d35d50afb64cf9f0e91da03c79.tar.gz swayrice-1519d69d7fb785d35d50afb64cf9f0e91da03c79.zip |
Merge branch 'master' of git.yaroslavps.com:public/configs/swayrice
Diffstat (limited to 'dotfiles/.local/bin')
-rwxr-xr-x | dotfiles/.local/bin/swayrecord | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/dotfiles/.local/bin/swayrecord b/dotfiles/.local/bin/swayrecord index 13b6e4d..27593be 100755 --- a/dotfiles/.local/bin/swayrecord +++ b/dotfiles/.local/bin/swayrecord @@ -10,7 +10,7 @@ if ! [ -d $AREC_DIR ]; then mkdir -p $AREC_DIR fi -DISPLAY="" +MONITOR="" OUTPUT="$(date '+%y%m%d-%H%M-%S')" TYPE="$1" VIDEO_PID="" @@ -70,7 +70,7 @@ killrecording () { } video () { - wf-recorder -o "$DISPLAY" -f "$VREC_DIR/video-$OUTPUT.mp4" & + wf-recorder -o "$MONITOR" -f "$VREC_DIR/video-$OUTPUT.mp4" & VIDEO_PID=$! echo $$ > ~/.cache/recordingpid echo "🔴" > ~/.cache/recordingicon @@ -84,7 +84,7 @@ screenshare () { loopbackcam="$(v4l2-ctl --list-devices | \ grep v4l2loopback -m1 -A1 | \ sed -e '1d' -e 's/\s//g')" - wf-recorder -o "$DISPLAY" -x yuv420p -c rawvideo -m v4l2 -f $loopbackcam & + wf-recorder -o "$MONITOR" -x yuv420p -c rawvideo -m v4l2 -f $loopbackcam & VIDEO_PID=$! echo $$ > ~/.cache/recordingpid echo "📺" > ~/.cache/recordingicon @@ -94,7 +94,7 @@ screenshare () { } screencast () { - wf-recorder -o "$DISPLAY" -f "$VREC_DIR/temp-$OUTPUT.mp4" & + wf-recorder -o "$MONITOR" -f "$VREC_DIR/temp-$OUTPUT.mp4" & VIDEO_PID=$! ffmpeg -f alsa -i default -c:a mp3 "$VREC_DIR/temp-$OUTPUT.mp3" & AUDIO_PID=$! @@ -132,9 +132,9 @@ if [ -f "$HOME/.cache/recordingpid" ]; then fi if [ $(swaymsg -t get_outputs | jq '. | length') -gt 1 ]; then -DISPLAY=$(swaymsg -t get_outputs | grep -E "name" | sed "s/^.*\"name\": \"//g;s/\",$//g;" | bemenu -p "Select display for capture: " --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR") +MONITOR=$(swaymsg -t get_outputs | grep -E "name" | sed "s/^.*\"name\": \"//g;s/\",$//g;" | bemenu -p "Select display for capture: " --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR") else - DISPLAY="$(swaymsg -t get_outputs | jq '.[0][\"name\"]')" + MONITOR="$(swaymsg -t get_outputs | jq -r '.[0]["name"]')" fi case $1 in |