From 42c22451aa0e0dd8f2bfeab7887e4689f7b16f18 Mon Sep 17 00:00:00 2001 From: xfnw Date: Sat, 9 Dec 2023 15:37:00 -0500 Subject: [PATCH] obv: do stuff in /tmp instead --- .config/i3/config | 4 ++-- bin/obv | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.config/i3/config b/.config/i3/config index 7e382fb..a6b8c35 100755 --- a/.config/i3/config +++ b/.config/i3/config @@ -105,8 +105,8 @@ bindsym $mod+space focus mode_toggle # take a screenshot bindsym --release $mod+s exec "scrot -l mode=edge -s -e 'curl -F\\"file=@$f\\" https://0x0.st/ | xclip -selection clipboard; mv $f ~/Pictures/scrot/'" -bindsym $mod+z exec "scrot -l mode=edge -oF ~/screen.png" -bindsym $mod+shift+z exec "scrot -l mode=edge -F ~/screen.png -e 'cp $f ~/screen.png'" +bindsym $mod+z exec "scrot -l mode=edge -oF /tmp/screen.png" +bindsym $mod+shift+z exec "scrot -l mode=edge -F /tmp/screen.png -e 'cp $f /tmp/screen.png'" bindsym $mod+shift+s exec "scrot -l mode=edge -e 'curl -F\\"file=@$f\\" https://0x0.st/ | xclip -selection clipboard; mv $f ~/Pictures/scrot/'" #bindsym --release $mod+x exec "scrot -l mode=edge -s -e 'curl -F\\"file=@$f\\" https://xfnw.ttm.sh/u.php | xclip -selection clipboard; mv $f ~/Pictures/scrot/'" diff --git a/bin/obv b/bin/obv index ebda546..6bc18fb 100755 --- a/bin/obv +++ b/bin/obv @@ -1,17 +1,20 @@ #!/bin/sh idiff() { - ffmpeg -i ~/screen.png -pattern_type glob -i 'i*.png' -filter_complex '[1]boxblur=1[m];[0][m]blend=all_mode=grainextract' o%03d.png + ffmpeg -i /tmp/screen.png -pattern_type glob -i 'i*.png' -filter_complex '[1]boxblur=1[m];[0][m]blend=all_mode=grainextract' o%03d.png } tile() { montage -background black -geometry 683x o*.png m.png } -mkdir -p ~/.cache/obv -cd ~/.cache/obv +mkdir -p /tmp/obv +cd /tmp/obv -while inotifywait -e close_write ~/screen.png +idiff +tile + +while inotifywait -e close_write /tmp/screen.png do sleep 0.1 idiff