elenapan/Scripts/screenshot.sh
elena 2c3484c224 updated screenshot script, now using maim instead of scrot
Former-commit-id: ee8634e03c
Former-commit-id: 7b0fd51d67db7da21b6ef198ae3b471f42782e75
Former-commit-id: 33a41cdb66c6c98b924edef1293d0b58f8d067c8
Former-commit-id: c86ddd40457d3e7ccdccb41ddda51635c53f9133
2018-05-16 21:10:00 +03:00

27 lines
921 B
Bash
Executable file

#!/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