diff --git a/i3/config b/i3/config index b494a12..a289310 100644 --- a/i3/config +++ b/i3/config @@ -75,6 +75,7 @@ bindsym $mod+Shift+Insert --release exec --no-startup-id maim ~/Pictures/$(date bindsym $mod+Ctrl+Insert exec --no-startup-id maim -s ~/Pictures/$(date +%Y-%m-%d).png&& pinta ~/Pictures/$(date +%Y-%m-%d-%s).png # screenshot and edit # Screen recording +bindsym Shift+Print exec --no-startup-id ~/.i3/screencast2gif.sh bindsym Print exec --no-startup-id "ffcast -q $(while slop -q -n -f '-g %g ';do :;done) rec ~/Videos/rec-%si-$(date +%Y-%m-%d-%s).mp4" bindsym $mod+Print exec --no-startup-id pkill -fxn '(/\S+)*ffmpeg\s.*\sx11grab\s.*' diff --git a/i3/screencast2gif.sh b/i3/screencast2gif.sh new file mode 100755 index 0000000..ac438f1 --- /dev/null +++ b/i3/screencast2gif.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +date=$(date +%Y-%m-%d-%s) + +ffmpeg() { + command ffmpeg -hide_banner -loglevel error -nostdin "$@" +} + +ffcast -q $(while slop -q -n -f '-g %g ';do :;done) rec ~/Videos/screencast-${date}.mp4 + +ffmpeg -i ~/Videos/screencast-${date}.mp4 -vf palettegen -f image2 -c:v png - | + ffmpeg -i ~/Videos/screencast-${date}.mp4 -i - -filter_complex paletteuse ~/Pictures/screencast-${date}.gif && notify-send "Gif recorded to ~/Pictures/screencast-${date}"