added screenshot scripts
This commit is contained in:
parent
1e4f85ffe7
commit
9d13b3496f
18
.local/share/scripts/take-screenshot.sh
Executable file
18
.local/share/scripts/take-screenshot.sh
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/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
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
TMPDIR=$(mktemp -d)
|
||||||
|
|
||||||
|
deepin-screenshot -n -s "$TMPDIR" 2>/dev/null
|
||||||
|
|
||||||
|
filename="$(date +"%d-%m-%y-%H-%M-%Z").png"
|
||||||
|
|
||||||
|
mv $TMPDIR/* "$TMPDIR/$filename"
|
||||||
|
|
||||||
|
printf "$TMPDIR/$filename"
|
||||||
|
|
15
.local/share/scripts/take-selected-screenshot.sh
Executable file
15
.local/share/scripts/take-selected-screenshot.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
SCRIPT=$(readlink -f "$0")
|
||||||
|
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||||
|
|
||||||
|
SCREENSHOT_DIR="$HOME/pictures/screenshots"
|
||||||
|
|
||||||
|
screenshotFile=$($SCRIPTPATH/take-screenshot.sh)
|
||||||
|
|
||||||
|
mv "$screenshotFile" "$SCREENSHOT_DIR"
|
||||||
|
rm -rf "$(dirname $screenshotFile)"
|
||||||
|
|
||||||
|
printf "$SCREENSHOT_DIR/$(basename $screenshotFile)"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user