2023-03-06 20:14:53 -08:00
|
|
|
#!/usr/bin/env zsh
|
|
|
|
|
|
|
|
local maim_args=("-f" "png")
|
2023-05-18 01:19:56 -07:00
|
|
|
local outfile="screenshot--$(date +'%F_%k-%M-%S').png"
|
|
|
|
local outpath="${HOME}/downloads/${outfile}"
|
2023-03-06 20:14:53 -08:00
|
|
|
|
|
|
|
case "${1}" in;
|
|
|
|
'-root')
|
2023-05-19 21:09:48 -07:00
|
|
|
maim ${maim_args} "${outpath}" || exit
|
2023-03-06 20:14:53 -08:00
|
|
|
;;
|
|
|
|
'-select' | *)
|
2023-05-19 21:09:48 -07:00
|
|
|
maim ${maim_args} -s "${outpath}" || exit
|
2023-03-06 20:14:53 -08:00
|
|
|
;;
|
|
|
|
esac
|
2023-05-18 01:19:56 -07:00
|
|
|
|
|
|
|
notify-send -t 5000 "Screenshot Taken" "Screenshot saved to \"${outfile}\""
|