fancy command

This commit is contained in:
Nox Sluijtman 2023-09-05 21:52:07 +02:00
parent bfcdff9f1f
commit ce8820ee79
2 changed files with 25 additions and 4 deletions

View file

@ -38,16 +38,36 @@ clip_focus(){
notify-send 'Maim utils' "Shot focussed window and sent it to the clipboard." notify-send 'Maim utils' "Shot focussed window and sent it to the clipboard."
} }
fancy(){
# nicked straight from the maim README (https://github.com/naelstrof/maim#examples)
maim -st 9999999 | convert - \( +clone -background black -shadow 80x3+5+5 \) +swap -background none -layers merge +repage shadow.png
notify-send 'Maim utils' "Shot selection and sent it to the clipboard.\nBe aware that the selection process can be cancelled using any keypress and that this won't show up due to xclip eating the exit status."
}
usage(){ usage(){
cat >&2 <<EOF cat >&2 <<EOF
Usage: maim-utils <screenshot-type> Usage: maim-utils <screenshot-type>
fullscreen|full: take screenshot of entire screen fullscreen|full: take screenshot of entire screen
selection|sel: take screenshot of rectangular selection selection|sel: take screenshot of rectangular selection
focus: take screenshot of focussed window focus: take screenshot of focussed window
clip-fullscreen|clip-full|full-clip: take screenshot of entire screen and output to clipboard
clip-selection|clip-sel|sel-clip: take screenshot of rectangular selection and output to clipboard clip-fullscreen|clip-full|full-clip: take screenshot of entire screen and
clip-focus|focus-clip: take screenshot of focussed window and output to clipboard output to clipboard
clip-selection|clip-sel|sel-clip: take screenshot of rectangular selection
and output to clipboard
clip-focus|focus-clip: take screenshot of focussed window and output to
clipboard
clip-selection|clip-sel|sel-clip: take screenshot of rectangular selection
and output to clipboard and give it a facy dropshadow
open|show|screenshots: open screenshot directory open|show|screenshots: open screenshot directory
EOF EOF
} }
@ -59,5 +79,6 @@ case $1 in
focus) focus;; focus) focus;;
clip-focus|focus-clip) clip_focus;; clip-focus|focus-clip) clip_focus;;
open|show|screenshots) xdg-open $savedir;; open|show|screenshots) xdg-open $savedir;;
fancy) fancy;;
*) usage;; *) usage;;
esac esac

View file

@ -1,6 +1,6 @@
#compdef maim-utils _maim-utils #compdef maim-utils _maim-utils
_arguments -C \ _arguments -C \
"1: :(focus fullscreen selection clip-selection clip-fullscreen clip-focus show)" \ "1: :(focus fullscreen selection clip-selection clip-fullscreen clip-focus show fancy)" \
"*::args:->args" "*::args:->args"
_arguments : $arguments _arguments : $arguments