From bcbccce6c0a9762170d5598b085a7109ff5c1069 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 2 Jan 2019 11:06:15 -0500 Subject: [PATCH] recording files moved to /tmp/ for cleanliness --- .config/i3blocks/config | 2 +- .scripts/i3cmds/dmenurecord | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.config/i3blocks/config b/.config/i3blocks/config index 89e3c1b..980d791 100644 --- a/.config/i3blocks/config +++ b/.config/i3blocks/config @@ -3,7 +3,7 @@ separator_block_width=15 markup=pango [record] -command=cat ~/.recordingicon +command=cat /tmp/recordingicon interval=once signal=9 diff --git a/.scripts/i3cmds/dmenurecord b/.scripts/i3cmds/dmenurecord index 7f0ea72..0047e7a 100755 --- a/.scripts/i3cmds/dmenurecord +++ b/.scripts/i3cmds/dmenurecord @@ -10,15 +10,15 @@ # If there is already a running instance, user will be prompted to end it. updateicon() { \ - echo "$1" > ~/.recordingicon + echo "$1" > /tmp/recordingicon pkill -RTMIN+9 i3blocks } killrecording() { - recpid="$(cat ~/.recordingpid)" + recpid="$(cat /tmp/recordingpid)" # kill with SIGTERM, allowing finishing touches. kill -15 "$recpid" - rm -f ~/.recordingpid + rm -f /tmp/recordingpid updateicon "" pkill -RTMIN+9 i3blocks # even after SIGTERM, ffmpeg may still run, so SIGKILL it. @@ -37,7 +37,7 @@ screencast() { \ -r 30 \ -c:v libx264rgb -crf 0 -preset ultrafast -c:a flac \ "$HOME/screencast-$(date '+%y%m%d-%H%M-%S').mkv" & - echo $! > ~/.recordingpid + echo $! > /tmp/recordingpid updateicon "⏺️🎙️" } @@ -47,7 +47,7 @@ video() { ffmpeg \ -i :0.0 \ -c:v libx264 -qp 0 -r 30 \ "$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" & - echo $! > ~/.recordingpid + echo $! > /tmp/recordingpid updateicon "⏺️" } @@ -56,7 +56,7 @@ webcamhidef() { ffmpeg \ -i /dev/video0 \ -video_size 1920x1080 \ "$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" & - echo $! > ~/.recordingpid + echo $! > /tmp/recordingpid updateicon "🎥" } @@ -65,7 +65,7 @@ webcam() { ffmpeg \ -i /dev/video0 \ -video_size 640x480 \ "$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" & - echo $! > ~/.recordingpid + echo $! > /tmp/recordingpid updateicon "🎥" } @@ -75,7 +75,7 @@ audio() { \ -f alsa -i default \ -c:a flac \ "$HOME/audio-$(date '+%y%m%d-%H%M-%S').flac" & - echo $! > ~/.recordingpid + echo $! > /tmp/recordingpid updateicon "🎙️" } @@ -101,5 +101,5 @@ case "$1" in audio) audio;; video) video;; kill) killrecording;; - *) ([ -f ~/.recordingpid ] && asktoend && exit) || askrecording;; + *) ([ -f /tmp/recordingpid ] && asktoend && exit) || askrecording;; esac