update:extend old scripts + new random ones
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
AGENTS.md
|
||||||
|
.pi
|
||||||
@@ -1,3 +1,31 @@
|
|||||||
#!/bin/bash
|
#!/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
|
||||||
|
|||||||
@@ -1,2 +1,44 @@
|
|||||||
#!/bin/bash
|
#!/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 <original-video> <new-video>"
|
||||||
|
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
|
||||||
|
|||||||
2
misc/detect-fff-pi
Executable file
2
misc/detect-fff-pi
Executable file
@@ -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"
|
||||||
4
misc/go-project-name-replacer
Executable file
4
misc/go-project-name-replacer
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
[ $# -ne 2 ] && { echo "Usage: go-project-name-replacer <old-name> <new-name>"; exit 1; }
|
||||||
|
grep -rl "$1" . | xargs sed -i "s/$1/$2/g"
|
||||||
|
|
||||||
Reference in New Issue
Block a user