From 71abf58c40b2537642dd8e4625d340901533fc09 Mon Sep 17 00:00:00 2001 From: Niklas Kapelle Date: Sun, 31 Mar 2024 23:16:00 +0200 Subject: [PATCH] updated scripts --- .local/share/scripts/made-changes.sh | 2 +- .local/share/scripts/save-screenshot.sh | 20 ++++++++++++++++++++ .local/share/scripts/take-screenshot.sh | 6 ++---- 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100755 .local/share/scripts/save-screenshot.sh diff --git a/.local/share/scripts/made-changes.sh b/.local/share/scripts/made-changes.sh index 5efc812..c171bc9 100755 --- a/.local/share/scripts/made-changes.sh +++ b/.local/share/scripts/made-changes.sh @@ -2,4 +2,4 @@ git add -A git commit -m "$(curl http://whatthecommit.com/index.txt)" -git push + diff --git a/.local/share/scripts/save-screenshot.sh b/.local/share/scripts/save-screenshot.sh new file mode 100755 index 0000000..a84a4c4 --- /dev/null +++ b/.local/share/scripts/save-screenshot.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env sh + +# Make a screenshots and save it in ~/pictures/screenshots + +set -e + +SCRIPT=$(readlink -f "$0") +SCRIPTPATH=$(dirname "$SCRIPT") + +SCREENSHOT_DIR="$HOME/pictures/screenshots" + +screenshotFile=$($SCRIPTPATH/take-screenshot.sh) + +mkdir -p "$SCREENSHOT_DIR" + +mv "$screenshotFile" "$SCREENSHOT_DIR" +rm -rf "$(dirname $screenshotFile)" + +printf "%s\n" "$SCREENSHOT_DIR/$(basename $screenshotFile)" + diff --git a/.local/share/scripts/take-screenshot.sh b/.local/share/scripts/take-screenshot.sh index 84ea361..bd681ea 100755 --- a/.local/share/scripts/take-screenshot.sh +++ b/.local/share/scripts/take-screenshot.sh @@ -1,8 +1,6 @@ #!/usr/bin/env sh -# makes a selection screenshot and prints out the filename in a date format -# not intended for direct use. Dosn't remove tmp dir -# required packages: -# - deepin-screenshot + +# Make a selection of the screen and take a screenshot. Save it to tmp and print its path. set -e