summaryrefslogtreecommitdiff
path: root/.local/bin/screenshot
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/screenshot')
-rwxr-xr-x.local/bin/screenshot28
1 files changed, 18 insertions, 10 deletions
diff --git a/.local/bin/screenshot b/.local/bin/screenshot
index 6d65898..3eed12b 100755
--- a/.local/bin/screenshot
+++ b/.local/bin/screenshot
@@ -1,17 +1,25 @@
#!/bin/sh
-if [ ! -n "$1" ]; then
- scrot -q 100 -e 'xclip -selection c -t image/png < $f; mv $f ~/Pictures/screenshots/'
-fi
+main () {
+ if [ ! -n "$1" ]; then
+ print_screen
+ fi
-while [ -n "$1" ]; do # while loop starts
case "$1" in
-s)
- sleep 0.2
- scrot -l mode=edge -i -s -e 'xclip -sel clip -t image/png $f; mv $f ~/Pictures/screenshots/'
- ;;
- *) echo "Option $1 not recognized" ;;
+ screenshot-select ;;
+ *)
+ echo "usage: screenshot [-s]" ;;
esac
- shift
-done
+}
+
+print_screen () {
+ scrot -q 100 -e 'xclip -selection c -t image/png < $f; mv $f ~/Pictures/screenshots/'
+}
+
+screenshot-select () {
+ sleep 0.2
+ scrot -l mode=edge -i -s -e 'xclip -sel clip -t image/png $f; mv $f ~/Pictures/screenshots/'
+}
+main "$@"