diff options
| author | Mitsuo Tokumori <[email protected]> | 2023-11-24 16:18:42 -0500 |
|---|---|---|
| committer | Mitsuo Tokumori <[email protected]> | 2023-11-24 16:18:42 -0500 |
| commit | 55bbf64b2cd05b93aa2288769515df9a8c2ed1bd (patch) | |
| tree | 02d89b44cf2e0d9b8d7ebeb8c3994d476c4d4436 /local/bin/screenshot.sh | |
| parent | 8342f7b3e776ebc482ba87723ba40015d2dab64e (diff) | |
| download | dotfiles-55bbf64b2cd05b93aa2288769515df9a8c2ed1bd.tar.gz dotfiles-55bbf64b2cd05b93aa2288769515df9a8c2ed1bd.tar.bz2 dotfiles-55bbf64b2cd05b93aa2288769515df9a8c2ed1bd.zip | |
Add screenshot script
Diffstat (limited to 'local/bin/screenshot.sh')
| -rwxr-xr-x | local/bin/screenshot.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/local/bin/screenshot.sh b/local/bin/screenshot.sh new file mode 100755 index 0000000..c15ce37 --- /dev/null +++ b/local/bin/screenshot.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Takes a screenshot and saves it + +# Inspired by Denshi's screenshot script (https://git.denshi.org/Scripts/tree/screenshot). +# See also https://www.youtube.com/watch?v=uYNTFg3_QaY&t=243s + +savepath="$HOME/media/Pictures/Screenshots" +filename="$HOSTNAME-$(date -Iseconds | tr -d ':-').png" + +if [ "$1" == "screen" ]; then + # capture the screen determined by the cursor location + shotgun -s "$savepath/$filename" +elif [ "$1" == "screens" ]; then + # TODO: This is not currently possible with shotgun 2.5.1 + : +else + # capture a region of the screen + shotgun -g $(hacksaw -c fff) "$savepath/$filename" +fi + |
