samedami 9d56d3e272
Add 'shelp' script
Also add simple description comment to all script.
2020-05-15 20:56:33 +02:00

32 lines
788 B
Bash
Executable File

#!/usr/bin/env sh
# Screenshoter script.
m() { rofi -dmenu -width 200 -i -l "$@"; }
mkdir -p ~/pix/Screenshots
screen_path=~/pix/Screenshots/$(date +%G-%m-%d_%s).png
screenshot() {
maim $type "$screen_path" &&
notify-send -u low -t 1400 -i "$screen_path" "Screenshot created!"
}
[ "$1" = "--force" ] && { screenshot && exit; }
type="$(printf " Screen\n Area\n" | m 2 -p 'Screenshoter')"
[ ! "$type" ] && exit
save="$(printf " No\n Yes" | m 2 -p 'Copy?')"
[ ! "$save" ] && exit
time="$(printf "0.7\n5\n10\n15" | m 3 -p 'Delay')"
[ ! "$time" ] && exit
[ "$type" = " Area" ] && type="-s -u" || type=""
sleep "$time"
screenshot
[ "$save" = " Yes" ] &&
xclip -sel clip /dev/null; sleep 0.5
xclip -selection clipboard -t image/png "$screen_path" || exit