record: add delete action

This commit is contained in:
2 * r + 2 * t
2025-06-08 00:40:16 +10:00
parent 10cd5f444d
commit 94c93e2d69
+3 -1
View File
@@ -64,7 +64,7 @@ if pgrep wl-screenrec > /dev/null
# Notification with actions # Notification with actions
set -l action (notify-send 'Recording stopped' "Stopped recording $new_recording_path" -i 'video-x-generic' -a 'caelestia-record' \ set -l action (notify-send 'Recording stopped' "Stopped recording $new_recording_path" -i 'video-x-generic' -a 'caelestia-record' \
--action='watch=Watch' --action='open=Open' --action='save=Save As') --action='watch=Watch' --action='open=Open' --action='save=Save As' --action='delete=Delete')
switch $action switch $action
case 'watch' case 'watch'
@@ -75,6 +75,8 @@ if pgrep wl-screenrec > /dev/null
case 'save' case 'save'
set -l save_file (app2unit -- zenity --file-selection --save --title='Save As') set -l save_file (app2unit -- zenity --file-selection --save --title='Save As')
test -n "$save_file" && mv $new_recording_path $save_file || warn 'No file selected' test -n "$save_file" && mv $new_recording_path $save_file || warn 'No file selected'
case 'delete'
rm $new_recording_path
end end
else else
# Set region if flag given otherwise active monitor # Set region if flag given otherwise active monitor