dotfiles-remastered/.local/share/scripts/take-selected-screenshot.sh

18 lines
346 B
Bash
Executable File

#!/usr/bin/env sh
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)"