diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7c786f4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +AGENTS.md +.pi diff --git a/mangowm/sc.sh b/mangowm/sc.sh index 800867a..c8909ef 100755 --- a/mangowm/sc.sh +++ b/mangowm/sc.sh @@ -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 diff --git a/media/video-compress.sh b/media/video-compress.sh index 7a4f0ed..df3d50b 100755 --- a/media/video-compress.sh +++ b/media/video-compress.sh @@ -1,2 +1,44 @@ #!/bin/bash -ffmpeg -i "$1" -c:v libx265 -crf 24 -preset medium -c:a aac -b:a 128k "$2" +set -euo pipefail + +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " + echo "Example: $0 input.mp4 output.webm" + exit 1 +fi + +INPUT="$1" +OUTPUT="$2" + +if [ ! -f "$INPUT" ]; then + echo "Error: input file not found: $INPUT" + exit 1 +fi + +if [ "$INPUT" = "$OUTPUT" ]; then + echo "Error: input and output must be different files" + exit 1 +fi + +EXT=$(printf '%s' "${OUTPUT##*.}" | tr '[:upper:]' '[:lower:]') + +case "$EXT" in + mp4) + ffmpeg -i "$INPUT" \ + -c:v libx265 -crf 24 -preset medium \ + -c:a aac -b:a 128k \ + -movflags +faststart \ + "$OUTPUT" + ;; + webm) + ffmpeg -i "$INPUT" \ + -c:v libvpx-vp9 -crf 32 -b:v 0 -deadline good -cpu-used 2 \ + -c:a libopus -b:a 128k \ + "$OUTPUT" + ;; + *) + echo "Error: unsupported output format '.$EXT'" + echo "Use output extension: .mp4 or .webm" + exit 1 + ;; +esac diff --git a/misc/detect-fff-pi b/misc/detect-fff-pi new file mode 100755 index 0000000..49015df --- /dev/null +++ b/misc/detect-fff-pi @@ -0,0 +1,2 @@ +#!/bin/bash +PIHOME="/home/kokopi/.pi/agent/sessions"; LATEST=$(find "$PIHOME" -name '*.jsonl' -type f -print0 | xargs -0 ls -t 2>/dev/null | head -n 1); echo "Session: $LATEST"; rg -n '"toolName":"find_files"|"toolName":"multi_grep"|"toolName":"grep"' "$LATEST" || echo "No fff tool calls found" diff --git a/misc/go-project-name-replacer b/misc/go-project-name-replacer new file mode 100755 index 0000000..34f9494 --- /dev/null +++ b/misc/go-project-name-replacer @@ -0,0 +1,4 @@ +#!/bin/bash +[ $# -ne 2 ] && { echo "Usage: go-project-name-replacer "; exit 1; } +grep -rl "$1" . | xargs sed -i "s/$1/$2/g" +