]> git.rmz.io Git - dotfiles.git/blob - bin/maif
lazyvim: absorb snacks notifier
[dotfiles.git] / bin / maif
1 #!/usr/bin/env bash
2
3 set -e
4
5 version="0.1"
6
7 function usage ()
8 {
9 echo "Usage : $0 [options] [FILE]
10
11 MAke Image File
12
13 Takes a screenshot using maim and saves it to FILE. If FILE is
14 not given it defaults to current timestamp, and geometry of
15 selection.
16
17 Options:
18 -h,--help Display this message"
19 }
20
21 # Parse arguments
22 declare -a args
23 while [[ $# -gt 0 ]]; do
24 opt="$1"
25
26 case $opt in
27 -h|--help) usage; exit 0 ;;
28 *) args+=("$opt"); shift ;;
29 esac
30 done
31
32 geometry="$(slop)"
33 file="$(date "+%FT%T_${geometry%%+*}_maif.png")"
34 maim "${args[@]}" --geometry="${geometry}" $file