1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-03-18 18:07:45 +01:00

17 lines
822 B
Plaintext
Raw Normal View History

2023-01-10 01:14:44 +01:00
#!/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"
2023-01-10 01:14:44 +01:00
xclip_cmd="xclip -sel clip -t image/png"
case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (clipboard)\\ncurrent window (clipboard)\\nfull screen (clipboard)\\ncolor picker (clipboard)" | dmenu -l 6 -i -p "Screenshot which area?")" in
"a selected area") maim -s $output ;;
"current window") maim -i "$(xdotool getactivewindow)" $output ;;
"full screen") maim $output ;;
"a selected area (clipboard)") maim -s | ${xclip_cmd} ;;
"current window (clipboard)") maim -i "$(xdotool getactivewindow)" | ${xclip_cmd} ;;
"full screen (clipboard)") maim | ${xclip_cmd} ;;
esac