dotfiles/scripts/.local/bin/shot

16 lines
465 B
Text
Raw Normal View History

2023-01-01 14:16:21 +00:00
#!/bin/env bash
# shot - Take a screenshot and upload it
# Depends on: share
filename=$(date "+%F_%T").png
flameshot_cmd="flatpak run org.flameshot.Flameshot"
if command -v $flameshot_cmd &> /dev/null; then
$flameshot_cmd gui -r | ~/.local/bin/share -f $filename - | grep "Hotlink:" | cut -d ' ' -f2 | xclip -selection c \
&& notify-send "Shot" "Screenshot URL copied to clipboard"
else
echo "No supported screenshot program found"
exit 1
fi