diff --git a/Scripts/screenshot.sh b/Scripts/screenshot.sh new file mode 100755 index 0000000..6cd47b4 --- /dev/null +++ b/Scripts/screenshot.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Screenshot wrapper +# Uses maim (which uses slop) +# "Friendship ended with scrot. Now maim is my best friend." + +SCREENSHOTS_DIR=~/Pictures/Screenshots +TIMESTAMP="$(date +%Y.%m.%d-%H.%M.%S)" +FILENAME=$SCREENSHOTS_DIR/$TIMESTAMP.screenshot.png +PHOTO_ICON_PATH=~/.icons/oomox-only_icons/categories/scalable/applications-photography.svg + + +# -u option hides cursor + +if [[ "$1" = "-s" ]]; then + # Area/window selection. + notify-send 'Select area or window to capture.' --urgency low -i $PHOTO_ICON_PATH + maim -u -s $FILENAME + notify-send "Screenshot taken." --urgency low -i $PHOTO_ICON_PATH +elif [[ "$1" = "-c" ]]; then + # Copy selection to clipboard + maim -u -s | xclip -selection clipboard -t image/png + notify-send "Copied selection to clipboard." --urgency low -i $PHOTO_ICON_PATH +else + # Full screenshot + maim -u $FILENAME + notify-send "Screenshot taken." --urgency low -i $PHOTO_ICON_PATH +fi diff --git a/Scripts/scrot_plus_notification.sh b/Scripts/scrot_plus_notification.sh deleted file mode 100755 index a3ee1c2..0000000 --- a/Scripts/scrot_plus_notification.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -if [[ "$1" = "-s" ]]; then - notify-send 'Select area to capture.' --icon=/home/elena/.icons/oomox-wally-flat/apps/scalable/gnome-screenshot.svg --urgency low - scrot -s '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/Pictures/Screenshots/'; - notify-send "Screenshot taken." --icon=/home/elena/.icons/oomox-wally-flat/apps/scalable/gnome-screenshot.svg --urgency low -else - scrot '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/Pictures/Screenshots/'; - notify-send "Screenshot taken." --icon=/home/elena/.icons/oomox-wally-flat/apps/scalable/gnome-screenshot.svg --urgency low -fi