replace home grown screenshotting with flameshot

This commit is contained in:
notgne2 2022-12-12 02:25:54 -07:00
parent 5ce906b628
commit 0f165c54f5
No known key found for this signature in database
3 changed files with 17 additions and 98 deletions

View file

@ -204,13 +204,9 @@ in {
#!${pkgs.zsh}/bin/zsh
fileid=$(${pkgs.pwgen}/bin/pwgen 16 1)
filename=$(basename $1)
extension=$(echo "''${filename##*.}" | awk '{gsub(/^ +| +$/,"")} {print $0}')
if [[ "$extension" = "$filename" ]] then
extension=$(grep "$(file -b --mime-type $1)" ${mimeTypes} | awk '{print $2}')
fi
extension=$(file "$1" --extension | cut -d' ' -f2 | sed 's/???/txt/')
rsync -a --chmod=664 "$1" "wizbos.club:~/public/uploads/$fileid.$extension"
ssh wizbos.club "cat > ~/public/uploads/$fileid.$extension" < "$1"
echo "https://p.gen2.space/uploads/$fileid.$extension"
'';