From 865728068c965e066d0f8971c5b5ba26e12e7dce Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Thu, 24 Dec 2020 00:06:27 +0530 Subject: Adds scripts and links scripts and wallpapers --- scripts/screenshot.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 scripts/screenshot.sh (limited to 'scripts/screenshot.sh') diff --git a/scripts/screenshot.sh b/scripts/screenshot.sh new file mode 100755 index 0000000..59770dd --- /dev/null +++ b/scripts/screenshot.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +SCREENSHOTS=$HOME/Pictures/screenshots; + +notify() { notify-send "$@"; } + +scrsht() { + local type=$1; + local window=$([ -z "$2" ] && echo "" || echo "-window $2"); + magick import $window "$SCREENSHOTS/$type-$(date '+%Y_%m_%d_%H_%M_%S').jpg"; + notify "Screenshot ($type) captured"; +} + +full_screenshot() { scrsht full root; } +part_screenshot() { sleep 0.2; scrsht part & disown; } +window_screenshot() { scrsht window "${1:-"$(xdo id)"}"; } + +case $1 in + full) full_screenshot ;; + part) part_screenshot ;; + window) window_screenshot "$2" ;; + *) echo "no"; exit 1 ;; +esac + -- cgit v1.3.1