recording notification added, script fixes

This commit is contained in:
Luke Smith 2018-06-15 21:48:42 -04:00
parent 748e984985
commit bc9de2e26a
5 changed files with 23 additions and 6 deletions

View file

@ -23,7 +23,8 @@ gaps outer 15
font pango:mono 12
set $mod Mod4
set $term --no-startup-id st
set $stoprec --no-startup-id killall ffmpeg
set $stoprec --no-startup-id killrecording
exec --no-startup-id rm -f ~/.larbs/.recording
# #---Starting External Scripts---# #
#Setting the background:

View file

@ -5,11 +5,11 @@
# It also names files smartly to prevent overwrites.
# Picks a file name for the output file based on availability:
while [[ -f $HOME/screencast$n.mkv ]]
while [[ -f $HOME/audio$n.flac ]]
do
n=$((n+1))
done
filename="$HOME/screencast$n.mkv"
filename="$HOME/audio$n.flac"
# For Pulseaudio with ALSA:
record_pulse() { \
@ -24,4 +24,6 @@ ffmpeg -y \
-f alsa -ar 44100 -i hw:1 \
$filename ;}
if [[ $(pgrep -x pulseaudio) ]]; then record_pulse; else record_alsa; fi
if [[ $(pgrep -x pulseaudio) ]]; then record_pulse; else record_alsa; fi &
# Updating i3blocks recording icon:
echo 🎙️ > ~/.scripts/.recording && pkill -RTMIN+9 i3blocks

9
.scripts/killrecording Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
# I'm not quite sure why, but a new non-recording instance of ffmpeg will start after
# being killed the first time, so the core command here runs twice after a break.
pkill -P $(pgrep -x screencast\|audio\|video) 2>/dev/null && sleep .5 &&
pkill -P $(pgrep -x screencast\|audio\|video) 2>/dev/null
# Update i3bar.
echo "" > ~/.scripts/.recording
pkill -RTMIN+9 i3blocks

View file

@ -33,4 +33,6 @@ ffmpeg -y \
-c:v libx264 -r 30 -c:a flac $filename ;}
if [[ $(pgrep -x pulseaudio) ]]; then record_pulse; else record_alsa; fi
if [[ $(pgrep -x pulseaudio) ]]; then record_pulse; else record_alsa; fi &
# Updating i3blocks recording icon:
echo ⏺️ > ~/.scripts/.recording && pkill -RTMIN+9 i3blocks

View file

@ -15,4 +15,7 @@ ffmpeg \
-f x11grab \
-s $(xdpyinfo | grep dimensions | awk '{print $2;}') \
-i :0.0 \
-c:v libx264 -qp 0 -r 30 $filename
-c:v libx264 -qp 0 -r 30 $filename &
# Updating i3blocks recording icon:
echo ⏺️ > ~/.scripts/.recording && pkill -RTMIN+9 i3blocks