From 87e4ddcbe2f3da98ae1d57b21e9bdbb8b8eef13e Mon Sep 17 00:00:00 2001 From: tsxv478 Date: Sun, 26 Nov 2023 13:15:40 +0300 Subject: screenshot script --- scr | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 scr (limited to 'scr') diff --git a/scr b/scr new file mode 100755 index 0000000..efea410 --- /dev/null +++ b/scr @@ -0,0 +1,13 @@ +#!/bin/sh + +output="$(date '+%y%m%d%H%M%S').png" +xclip_cmd="xclip -selection clipboard -t image/png" + +case "$(printf "selected area\\ncurrent window\\nfull screen\\nselected area (copy)\\ncurrent window (copy)\\nfull screen (copy)" | dmenu -i -c -l 6 -p "Screenshot area?")" in + "selected area") maim -u -s img-sel-"${output}" ;; + "current window") maim -u -B -q -d 0.2 -i "$(xdotool getactivewindow)" img-win-"${output}" ;; + "full screen") maim -u -q -d 0.2 img-full-"${output}" ;; + "selected area (copy)") maim -u -s | ${xclip_cmd} ;; + "current window (copy)") maim -u -B -q -d 0.2 -i "$(xdotool getactivewindow)" | ${xclip_cmd} ;; + "full screen (copy)") maim -u -q -d 0.2 | ${xclip_cmd} ;; +esac -- cgit v1.2.3