commit 7dfca8057f8237b07416f2a91e017694e21bde76 parent d3e03c499e83a3a785d23feca09395686e946b9a Author: mtmn <miro@haravara.org> Date: Mon, 25 May 2026 23:27:29 +0200 chore: scup/recup fixes Diffstat:
| M | modules/mixins/dotfiles/bin/recup | | | 12 | ++++++++---- |
| M | modules/mixins/dotfiles/bin/scup | | | 11 | +++++++---- |
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/modules/mixins/dotfiles/bin/recup b/modules/mixins/dotfiles/bin/recup @@ -1,10 +1,14 @@ #!/bin/sh -cd ~/misc/recordings || exit 1 -PICKED=$(eza --oneline --reverse --sort=created | fzf --reverse \ - --preview="ffmpeg -i {} -vf 'select=eq(n\,0)' -frames:v 1 -f image2pipe -vcodec png - 2>/dev/null | chafa --format=sixels --size=\${FZF_PREVIEW_COLUMNS}x\${FZF_PREVIEW_LINES} - 2>/dev/null || stat {}") + +recdir="$HOME/misc/recordings" + +mkdir -p "$recdir" + +PICKED=$(eza --oneline --reverse --sort=created "$recdir" | fzf --reverse \ + --preview="ffmpeg -i $recdir/{} -vf 'select=eq(n\,0)' -frames:v 1 -f image2pipe -vcodec png - 2>/dev/null | chafa --format=sixels --size=\${FZF_PREVIEW_COLUMNS}x\${FZF_PREVIEW_LINES} - 2>/dev/null || stat $recdir/{}") if [ -n "$PICKED" ]; then - ffmpeg -i "$PICKED" -c:v libvpx-vp9 -deadline realtime -cpu-used 8 -crf 30 -b:v 0 -c:a libopus -b:a 128k -f webm - | + ffmpeg -i "$recdir/$PICKED" -c:v libvpx-vp9 -deadline realtime -cpu-used 8 -crf 30 -b:v 0 -c:a libopus -b:a 128k -f webm - | aws s3 cp - "s3://recordings/${PICKED%.*}.webm" --content-type video/webm shirt "$(aws s3 presign "s3://recordings/${PICKED%.*}.webm" --expires-in 604800 | tr -d '\n')" diff --git a/modules/mixins/dotfiles/bin/scup b/modules/mixins/dotfiles/bin/scup @@ -1,10 +1,13 @@ #!/bin/sh -cd ~/misc/screenshots || exit 1 -PICKED=$(eza --oneline --reverse --sort=created | fzf --reverse \ - --preview="chafa --format=sixels --size=\${FZF_PREVIEW_COLUMNS}x\${FZF_PREVIEW_LINES} {} 2>/dev/null || stat {}") +scdir="$HOME/misc/screenshots" + +mkdir -p "$scdir" + +PICKED=$(eza --oneline --reverse --sort=created "$scdir" | fzf --reverse \ + --preview="chafa --format=sixels --size=\${FZF_PREVIEW_COLUMNS}x\${FZF_PREVIEW_LINES} $scdir/{} 2>/dev/null || stat $scdir/{}") if [ -n "$PICKED" ]; then - aws s3 cp "$PICKED" "s3://screenshots/$PICKED" + aws s3 cp "$scdir/$PICKED" "s3://screenshots/$PICKED" shirt "$(aws s3 presign "s3://screenshots/$PICKED" --expires-in 86400 | tr -d '\n')" fi