summaryrefslogtreecommitdiffstats
path: root/.scripts
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2018-06-15 21:48:42 -0400
committerLuke Smith <luke@lukesmith.xyz>2018-06-15 21:48:42 -0400
commitbc9de2e26a1ce5e4033bd63c94f22b3bab11e808 (patch)
treee9347deced2dff63820334d0dfb4c24b87e57bef /.scripts
parent748e9849856ec66374b0f1280a3137ae4f661b43 (diff)
downloadeibhear-bc9de2e26a1ce5e4033bd63c94f22b3bab11e808.tar.gz
eibhear-bc9de2e26a1ce5e4033bd63c94f22b3bab11e808.tar.zst
eibhear-bc9de2e26a1ce5e4033bd63c94f22b3bab11e808.zip
recording notification added, script fixes
Diffstat (limited to '.scripts')
-rwxr-xr-x.scripts/audio8
-rwxr-xr-x.scripts/killrecording9
-rwxr-xr-x.scripts/screencast4
-rwxr-xr-x.scripts/video5
4 files changed, 21 insertions, 5 deletions
diff --git a/.scripts/audio b/.scripts/audio
index cb630c8..6c5059e 100755
--- a/.scripts/audio
+++ b/.scripts/audio
@@ -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
diff --git a/.scripts/killrecording b/.scripts/killrecording
new file mode 100755
index 0000000..b7c9827
--- /dev/null
+++ b/.scripts/killrecording
@@ -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
diff --git a/.scripts/screencast b/.scripts/screencast
index cd37ab9..fd09ca0 100755
--- a/.scripts/screencast
+++ b/.scripts/screencast
@@ -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
diff --git a/.scripts/video b/.scripts/video
index 357464f..cc81bff 100755
--- a/.scripts/video
+++ b/.scripts/video
@@ -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