diff options
| author | 2026-04-21 01:23:18 +0100 | |
|---|---|---|
| committer | 2026-04-21 01:23:18 +0100 | |
| commit | 9b2af4dd6c73ea57cc921f41120db7a2700e806d (patch) | |
| tree | 66ee69c6d3ece244888ad4a44016e861700059ef /home/.local/bin/record | |
| parent | 288f0dd4757f373a4ef7293020d2be94c983f502 (diff) | |
| download | dotfiles-9b2af4dd6c73ea57cc921f41120db7a2700e806d.tar.gz dotfiles-9b2af4dd6c73ea57cc921f41120db7a2700e806d.tar.bz2 dotfiles-9b2af4dd6c73ea57cc921f41120db7a2700e806d.zip | |
refactor: remove stow home/ directory (preparing for chezmoi source state)
Diffstat (limited to 'home/.local/bin/record')
| -rwxr-xr-x | home/.local/bin/record | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/home/.local/bin/record b/home/.local/bin/record deleted file mode 100755 index 00ac367..0000000 --- a/home/.local/bin/record +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env sh - -pid_file="/tmp/recordpid" -log_file="/tmp/record.log" - -pid_exists() { - test -r "$pid_file" -} - -is_running() { - if pid_exists; then - ps "$(cat "$pid_file")" >/dev/null 2>&1 || return 1 - else - return 1 - fi -} - -start() { - notify-send -t 500 "Record started!" & - sleep 0.5 - - wf-recorder -f "$HOME/vids/$(date '+%y%m%d-%H%M-%S').mkv" >"$log_file" 2>&1 & - echo "$!" >"$pid_file" -} - -stop() { - pid_exists || exit 1 - pid="$(cat "$pid_file")" - # kill with SIGTERM, allowing finishing touches. - kill "$pid" - # even after SIGTERM, ffmpeg may still run, so SIGKILL it. - sleep 3 - is_running && kill -9 "$pid" - rm -f "$pid_file" - notify-send "Record stopped!" -} - -toggle() { - if is_running; then - echo "Stopping record" - stop - else - echo "Starting record" - start - fi - echo - status -} - -status() { - if is_running; then - echo "Recording with PID $(cat "$pid_file")" - echo "Check the logs at" - echo - echo "$log_file" - echo - else - echo "Record inactive" - fi -} -case "$1" in - start) - start - ;; - stop) - stop - ;; - toggle) - toggle - ;; - status) - status - ;; - *) - toggle - ;; -esac |
