aboutsummaryrefslogtreecommitdiff
path: root/local
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2024-10-19 10:46:58 +0200
committerCharles Cabergs <me@cacharle.xyz>2024-10-19 10:46:58 +0200
commitadac84227102a191866c46f63a719e6634c6c4ae (patch)
tree2fd0683de5543f44c02a4de0f989a6c1e8000a6b /local
parent2f4f67a5067528c140e32367072f84a22fb2698e (diff)
downloaddotfiles-adac84227102a191866c46f63a719e6634c6c4ae.tar.gz
dotfiles-adac84227102a191866c46f63a719e6634c6c4ae.tar.bz2
dotfiles-adac84227102a191866c46f63a719e6634c6c4ae.zip
Save screenshots to specific directory, add video to x264 script
Diffstat (limited to 'local')
-rwxr-xr-xlocal/bin/screenshot-prompt6
-rwxr-xr-xlocal/bin/video-to-x2646
2 files changed, 10 insertions, 2 deletions
diff --git a/local/bin/screenshot-prompt b/local/bin/screenshot-prompt
index b449f60..f88989a 100755
--- a/local/bin/screenshot-prompt
+++ b/local/bin/screenshot-prompt
@@ -18,16 +18,18 @@ EOF
)"
screenshot_dir="$HOME/screenshots"
+[ ! -d "$screenshot_dir" ] && mkdir "$screenshot_dir"
+file_format="$screenshot_dir/"'%Y-%m-%d_$wx$h.png'
case "$choice" in
'Crop to file')
- scrot --select --silent
+ scrot --select --silent --file "$file_format"
;;
'Crop to clipboard')
scrot --select --silent - | xclip -selection clipboard -target image/png
;;
'Fullscreen to file')
- scrot --silent
+ scrot --silent --file "$file_format"
;;
'Fullscreen to clipboard')
scrot --silent - | xclip -selection clipboard -target image/png
diff --git a/local/bin/video-to-x264 b/local/bin/video-to-x264
new file mode 100755
index 0000000..ed15b56
--- /dev/null
+++ b/local/bin/video-to-x264
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+ffmpeg -hwaccel cuda \
+ -i "$1.mp4" \
+ -map 0 -c:v libx264 -crf 18 -vf format=yuv420p -c:a copy \
+ "$1-x264.mp4"