diff options
| author | Mitsuo Tokumori <[email protected]> | 2024-09-11 04:25:38 +0900 |
|---|---|---|
| committer | Mitsuo Tokumori <[email protected]> | 2024-09-11 04:25:38 +0900 |
| commit | 37ff7062874b72bafa99afe661f42653565ed511 (patch) | |
| tree | 60372bf7fdb94c9034c7d1cc5a17cd7df526c4fc /public/.local/bin/screenshot.sh | |
| parent | dca319b8d9d221f1aaf3a00ee457d202096c66ac (diff) | |
| download | dotfiles-37ff7062874b72bafa99afe661f42653565ed511.tar.gz dotfiles-37ff7062874b72bafa99afe661f42653565ed511.tar.bz2 dotfiles-37ff7062874b72bafa99afe661f42653565ed511.zip | |
RESTRUCTURE. Replicate relative paths in public/
Diffstat (limited to 'public/.local/bin/screenshot.sh')
| -rwxr-xr-x | public/.local/bin/screenshot.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/public/.local/bin/screenshot.sh b/public/.local/bin/screenshot.sh new file mode 100755 index 0000000..be4a8f9 --- /dev/null +++ b/public/.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) "$savepath/$filename" +fi + |
