update:extend old scripts + new random ones

This commit is contained in:
2026-04-11 22:15:55 +09:00
parent e78e9b25f1
commit 9a23290c39
5 changed files with 81 additions and 3 deletions

View File

@@ -1,3 +1,31 @@
#!/bin/bash
if pgrep -x wl-screenrec > /dev/null; then pkill -INT wl-screenrec && notify-send "🎥 Recording Stopped" "Saved to ~/videos"; else GEOMETRY=$(slurp); if [ -n "$GEOMETRY" ]; then notify-send "🎥 Recording Started" "Press Super+Alt+v to stop" && wl-screenrec -g "$GEOMETRY" -f ~/videos/recording-$(date +"%Y-%m-%d_%H-%M-%S").mp4 & fi; fi
# if pgrep -x wl-screenrec > /dev/null; then pkill -INT wl-screenrec && notify-send "🎥 Recording Stopped" "Saved to ~/videos"; else GEOMETRY=$(slurp); if [ -n "$GEOMETRY" ]; then wl-screenrec -g "$GEOMETRY" -f ~/videos/recording-$(date +"%Y-%m-%d_%H-%M-%S").mp4 & fi; fi
MODE=${1:-area}
OUTPUT=~/videos/recording-$(date +"%Y-%m-%d_%H-%M-%S").mp4
if pgrep -x wl-screenrec >/dev/null; then
pkill -INT wl-screenrec
notify-send "🎥 Recording Stopped" "Saved to ~/videos"
exit 0
fi
case "$MODE" in
area)
GEOMETRY=$(slurp)
if [ -n "$GEOMETRY" ]; then
notify-send "🎥 Recording Started (Area)" "Press Super+Alt+v to stop"
wl-screenrec -g "$GEOMETRY" -f "$OUTPUT" &
fi
;;
screen)
GEOMETRY=$(slurp -o)
if [ -n "$GEOMETRY" ]; then
notify-send "🎥 Recording Started (Screen)" "Press Super+Alt+v to stop"
wl-screenrec -g "$GEOMETRY" -f "$OUTPUT" &
fi
;;
*)
echo "Usage: $0 [area|screen]"
exit 1
;;
esac