random-scripts/old/x11/screenshot.sh

17 lines
399 B
Bash
Executable File

#!/usr/bin/env zsh
local maim_args=("-f" "png")
local outfile="screenshot--$(date +'%F_%k-%M-%S').png"
local outpath="${HOME}/downloads/${outfile}"
case "${1}" in;
'-root')
maim ${maim_args} "${outpath}" || exit
;;
'-select' | *)
maim ${maim_args} -s "${outpath}" || exit
;;
esac
notify-send -t 5000 "Screenshot Taken" "Screenshot saved to \"${outfile}\""