From adac84227102a191866c46f63a719e6634c6c4ae Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sat, 19 Oct 2024 10:46:58 +0200 Subject: Save screenshots to specific directory, add video to x264 script --- local/bin/screenshot-prompt | 6 ++++-- local/bin/video-to-x264 | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100755 local/bin/video-to-x264 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" -- cgit