#!/bin/sh FILENAME=$(date +%m-%d-%Y_%R:%S) mkdir -p ~/pictures/screenshots # using ImageMagick's import #if [ $1 = 1 ]; then # import clipboard: # notify-send "Screenshot taken" "copied to clipboard" -i : #else # import -window root ~/pictures/screenshots/"$FILENAME".png # notify-send "Screenshot taken" "saved to ~/pictures/screenshots/$FILENAME.png" -i : #fi # using naelstrof's maim and slop if [ $1 = 1 ]; then #maim -i $(xdotool getactivewindow) | xclip -selection clipboard -t image/png CHOICE=$(printf "clipboard\nfile" | dmenu -c -i -l 2) case $CHOICE in "clipboard") maim -s | xclip -selection clipboard -t image/png notify-send "Screenshot taken" "copied to clipboard" -i :;; "file") maim -s ~/pictures/screenshots/"$FILENAME".bmp notify-send "Screenshot taken" "saved to ~/pictures/screenshots/$FILENAME.bmp" -i :;; esac else maim ~/pictures/screenshots/"$FILENAME".bmp notify-send "Screenshot taken" "saved to ~/pictures/screenshots/$FILENAME.png" -i : fi