From 01abbff07781d55101f5a347634de49631709579 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Fri, 6 Sep 2024 10:34:05 +0800 Subject: more hyprland scripts --- wf-record | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 wf-record (limited to 'wf-record') 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 -- cgit v1.2.3