adding sxiv and changing screenshot prog

This commit is contained in:
Chris Cochrun 2021-04-20 08:21:56 -05:00
parent deef4f3192
commit 02e22a7711
6 changed files with 83 additions and 6 deletions

View file

@ -1,3 +1,28 @@
#!/bin/sh
#!/bin/bash
maim --hidecursor --select | xclip -selection clipboard -target image/png
timestamp=$(date +%F-%T)
picture=$(maim --hidecursor --select /tmp/$timestamp.png)
declare -a options=(
"clipboard"
"filesave"
"cancel"
)
choice=$(printf '%s\n' "${options[@]}" | rofi -dmenu -p 'Clip or Save')
if [[ "$choice" == "cancel" ]]; then
rm /tmp/$timestamp.png
echo "Canceled." && exit 1
elif [ "$choice" == "clipboard" ]; then
xclip -selection clipboard -target image/png -i /tmp/$timestamp.png
rm /tmp/$timestamp.png
echo 'saved to clipboard'
elif [ "$choice" == "filesave" ]; then
mv /tmp/$timestamp.png ~/Pictures/$timestamp.png
echo 'saved to ~/Pictures/'$timestamp'.png'
fi