mirror of https://github.com/tiyn/dotfiles
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
916 B
19 lines
916 B
1 year ago
|
#!/bin/sh
|
||
|
|
||
|
# Requires maim. It lets you choose the kind of screenshot to take,
|
||
|
# including copying the image or even highlighting an area to copy.
|
||
|
|
||
|
output="$HOME/downloads/screenshot-$(date '+%Y-%m-%d_%H-%M-%S').png"
|
||
|
xclip_img="xclip -sel clip -t image/png"
|
||
|
xclip_txt="xclip -sel clip -t text/plain"
|
||
|
|
||
1 year ago
|
case "$(printf "a selected area\\na selected area (copy)\\ncurrent window\\ncurrent window (copy)\\nfull screen\\nfull screen (copy)\\ncolor picker (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in
|
||
7 months ago
|
"a selected area") maim -s --hidecursor $output ;;
|
||
|
"a selected area (copy)") maim -s --hidecursor | ${xclip_img} ;;
|
||
1 year ago
|
"current window") maim -i "$(xdotool getactivewindow)" $output ;;
|
||
1 year ago
|
"current window (copy)") maim -i "$(xdotool getactivewindow)" | ${xclip_img} ;;
|
||
1 year ago
|
"full screen") maim $output ;;
|
||
1 year ago
|
"full screen (copy)") maim | ${xclip_img} ;;
|
||
|
"color picker (copy)") xcolor |tr -d '\n' | ${xclip_txt} ;;
|
||
|
esac
|