diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-09-06 10:34:05 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-09-06 10:34:05 +0800 |
| commit | 01abbff07781d55101f5a347634de49631709579 (patch) | |
| tree | 6069e2ea6e007ff932cdfa917d922b9b1c186230 /wf-record | |
| parent | 582c7ad0569e4bc52a86b38e9a51f07f41842e15 (diff) | |
more hyprland scripts
Diffstat (limited to 'wf-record')
| -rwxr-xr-x | wf-record | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/wf-record b/wf-record new file mode 100755 index 0000000..a271a80 --- /dev/null +++ b/wf-record @@ -0,0 +1,25 @@ +#!/bin/sh + +XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache} + +if pgrep wf-recorder; then + filename=$(cat $XDG_CACHE_HOME/recorded_filename) + killall -s SIGINT wf-recorder + notify-send "Recording Complete" + while [ ! -z $(pgrep -x wf-recorder) ]; do wait; done + pkill -RTMIN+8 waybar + ffmpeg -i "$HOME/Videos/$filename.mkv" -c:v libx264rgb -c:a aac "$HOME/Videos/$filename.mp4" & +else + filename=$(date +%F_%T) + echo $filename > $XDG_CACHE_HOME/recorded_filename + notify-send "Recording Started" + if [ "$1" == "-s" ] + then wf-recorder --codec libx264rgb -f "$HOME/Videos/$filename.mkv" --audio=alsa_output.pci-0000_00_1f.3.analog-stereo.monitor -g "$(slurp || notify-send "Recording Canceled"; exit 1)" >/dev/null & + sleep 2 + while [ ! -z $(pgrep -x slurp) ]; do wait; done + pkill -RTMIN+8 waybar + else + wf-recorder --codec libx264rgb -f "$HOME/Videos/$filename.mkv" -a --audio=alsa_output.pci-0000_00_1f.3.analog-stereo.monitor & + pkill -RTMIN+8 waybar + fi +fi |
