From 6fff5b9c2f216ff68334de853b67427b884935a2 Mon Sep 17 00:00:00 2001 From: Andrew DeFaria Date: Fri, 22 Apr 2022 09:50:28 -0700 Subject: [PATCH 1/1] Updated screen capture scripts --- bin/capture-area.sh | 17 ++++++++++++++++- bin/capture-window.sh | 17 ++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/bin/capture-area.sh b/bin/capture-area.sh index 8540f6d..5197f95 100755 --- a/bin/capture-area.sh +++ b/bin/capture-area.sh @@ -1,2 +1,17 @@ #!/bin/bash -gnome-screenshot -caf /System/tmp/Screenshots/$(date +%F@%T).png +timeout=10 +screenshot_directory=/tmp + +function yesno { + question=$1 + + zenity --question --text "$question" --width=300 --timeout=$timeout 2> /dev/null +} + +mate-screenshot -ac + +file="$screenshot_directory/Screenshots/$(date +%F@%T).png + +if yesno "Save screenshot as $file?"; then + xclip -selection clipboard -t image/png -o > $file +fi diff --git a/bin/capture-window.sh b/bin/capture-window.sh index ce75bdd..126b8e4 100755 --- a/bin/capture-window.sh +++ b/bin/capture-window.sh @@ -1,2 +1,17 @@ #!/bin/bash -gnome-screenshot -cwf /System/tmp/Screenshots/$(date +%F@%T).png +timeout=10 +screenshot_directory=/tmp + +function yesno { + question=$1 + + zenity --question --text "$question" --width=300 --timeout=$timeout 2> /dev/null +} + +mate-screenshot -wc + +file=$screenshot_directory/Screenshots/$(date +%F@%T).png + +if yesno "Save screenshot as $file?"; then + xclip -selection clipboard -t image/png -o > $file +fi -- 2.17.1