aboutsummaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
authorawy <awy@awy.one>2025-11-08 00:08:48 +0300
committerawy <awy@awy.one>2025-11-08 00:08:48 +0300
commit2f1c71de8eaccca21443f1e780081e5e48693646 (patch)
treef62e7e7eb229d445c02f33b4eb141f8911ad47d9 /.local/bin
parent7df19e880ce1581a79f3f9c48069fba260ef3457 (diff)
downloadhyprdots-2f1c71de8eaccca21443f1e780081e5e48693646.tar.gz
replay option + -fm content
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/dmenurecord33
1 files changed, 32 insertions, 1 deletions
diff --git a/.local/bin/dmenurecord b/.local/bin/dmenurecord
index 31ee981..b81f4d7 100755
--- a/.local/bin/dmenurecord
+++ b/.local/bin/dmenurecord
@@ -16,6 +16,7 @@ killrecording() {
screencast() { gpu-screen-recorder \
-w portal \
+ -fm content \
-f 60 \
-a default_output \
-a default_input \
@@ -26,6 +27,7 @@ screencast() { gpu-screen-recorder \
video() { gpu-screen-recorder \
-w portal \
+ -fm content \
-f 60 \
-o "$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" &
echo $! > /tmp/recordingpid
@@ -60,10 +62,33 @@ audio() { \
updateicon ""
}
+replay() { gpu-screen-recorder \
+ -w portal \
+ -fm content \
+ -f 60 \
+ -r 60 \
+ -c mkv \
+ -a default_output \
+ -a default_input \
+ -o "/mnt/ssd/rndm/clips/replays" &
+ echo $! > /tmp/recordingpid
+ updateicon "󰑙 󰑋 "
+}
+
+savereplay() {
+ recpid="$(bat /tmp/recordingpid)"
+ echo $recpid
+ kill -37 "$recpid"
+ pkill -RTMIN+9 "${STATUSBAR:-waybar}"
+ notify-send "Replay" "Last 60 seconds saved"
+ exit
+}
+
askrecording() { \
- choice=$(printf "screencast\\nvideo\\naudio\\nwebcam\\nwebcam (hi-def)" | mew -i -p "Select recording style:")
+ choice=$(printf "screencast\\nreplay\\nvideo\\naudio\\nwebcam\\nwebcam (hi-def)" | mew -i -p "Select recording style:")
case "$choice" in
screencast) screencast;;
+ replay) replay;;
audio) audio;;
video) video;;
webcam) webcam;;
@@ -72,12 +97,18 @@ askrecording() { \
}
asktoend() { \
+ if grep -q "󰑙" /tmp/recordingicon; then
+ response=$(printf "No\\nYes" | mew -i -p "Replay is active. Save it?") &&
+ [ "$response" = "Yes" ] && savereplay
+ fi
+
response=$(printf "No\\nYes" | mew -i -p "Recording still active. End recording?") &&
[ "$response" = "Yes" ] && killrecording
}
case "$1" in
screencast) screencast;;
+ replay) replay;;
audio) audio;;
video) video;;
kill) killrecording;;