#!/usr/bin/env zsh local maim_args=("-f" "png") local outfile="${HOME}/downloads/screenshot--$(date +'%F_%k-%M-%S').png" case "${1}" in; '-root') maim ${maim_args} "${outfile}" ;; '-select' | *) maim ${maim_args} -s "${outfile}" ;; esac