#!/bin/sh # # Takes a screenshot with grimshot, in clipboard or in given directory # DIR="$HOME/downloads/screenshots" MODE=$(printf "save\ncopy" | dmenu) # If dmenu was cancelled, exit program if [ $? -ne 0 ]; then exit 1 fi mkdir -p $DIR case "$MODE" in *save*) cd $DIR timestamp=$(date +"%Y-%m-%d_%H-%M-%S") grimshot save area "$timestamp.png" ;; *copy*) grimshot copy area ;; esac