Usage in script

This commit is contained in:
Nox Sluijtman 2023-01-19 15:42:59 +01:00
parent ad1b0e2538
commit 214d8127f1

View file

@ -36,6 +36,18 @@ 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."
} }
usage(){
cat >&2 <<EOF
Usage: maim-utils <screenshot-type>
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
open|show|screenshots: open screenshot directory
EOF
case $1 in case $1 in
sel|selection) selection;; sel|selection) selection;;
sel-clip|clip-sel|clip-selection) clip_selection;; sel-clip|clip-sel|clip-selection) clip_selection;;
@ -44,4 +56,5 @@ case $1 in
focus) foucs;; focus) foucs;;
clip-focus|focus-clip) clip_focus;; clip-focus|focus-clip) clip_focus;;
open|show|screenshots) xdg-open $savedir;; open|show|screenshots) xdg-open $savedir;;
*) usage;;
esac esac