aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/.local/bin/scrot_cmd35
1 files changed, 35 insertions, 0 deletions
diff --git a/bin/.local/bin/scrot_cmd b/bin/.local/bin/scrot_cmd
new file mode 100755
index 0000000..827ddf7
--- /dev/null
+++ b/bin/.local/bin/scrot_cmd
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# a simple scrot wrapper to be used wm-agnostically
+
+scrot_cmd() {
+ # shellcheck disable=SC2086
+
+ # scrot_cmd flags path
+
+ scrot $1 "$2" -e "notify-send -t 3000 \"scrot\" \"screenshot \$f saved\""
+}
+
+main() {
+
+ _scrot_dir="$HOME/Pictures/Screenshots"
+ _scrot_name="%Y-%m-%d-%s_\$wx\$h_scrot.png"
+ _scrot_path="$_scrot_dir/$_scrot_name"
+
+ case $1 in
+ -f|--full)
+ scrot_cmd "" "$_scrot_path"
+ ;;
+ -a|--area)
+ scrot_cmd "-sf" "$_scrot_path"
+ ;;
+ -c|--focused)
+ scrot_cmd "-u" "$_scrot_path"
+ ;;
+ *)
+ exit 1
+ ;;
+ esac
+}
+
+main "$@"