From ce8820ee798928cb5a91443788b6bd1086778c3b Mon Sep 17 00:00:00 2001 From: Marty Sluijtman Date: Tue, 5 Sep 2023 21:52:07 +0200 Subject: [PATCH] fancy command --- maim-utils | 27 ++++++++++++++++++++++++--- zsh.completion | 2 +- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/maim-utils b/maim-utils index fa9893d..3866b31 100755 --- a/maim-utils +++ b/maim-utils @@ -38,16 +38,36 @@ clip_focus(){ 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(){ cat >&2 < + fullscreen|full: take screenshot of entire screen + selection|sel: take screenshot of rectangular selection + 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-focus|focus-clip: take screenshot of focussed window and output to clipboard + + 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-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 + EOF } @@ -59,5 +79,6 @@ case $1 in focus) focus;; clip-focus|focus-clip) clip_focus;; open|show|screenshots) xdg-open $savedir;; + fancy) fancy;; *) usage;; esac diff --git a/zsh.completion b/zsh.completion index 5c62c26..0d038f8 100644 --- a/zsh.completion +++ b/zsh.completion @@ -1,6 +1,6 @@ #compdef maim-utils _maim-utils _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" _arguments : $arguments