#!/usr/bin/env bash set -e version="0.1" function usage () { echo "Usage : $0 [options] [FILE] MAke Image File Takes a screenshot using maim and saves it to FILE. If FILE is not given it defaults to current timestamp, and geometry of selection. Options: -h,--help Display this message" } # Parse arguments declare -a args while [[ $# -gt 0 ]]; do opt="$1" case $opt in -h|--help) usage; exit 0 ;; -* ) echo -e "\n Option does not exist : $opt\n" usage; exit 1 ;; *) args+=("$opt"); shift ;; esac done geometry="$(slop)" file="$(date "+%FT%T_${geometry%%+*}_maif.png")" maim --geometry="${geometry}" $file