diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2024-10-18 05:32:12 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2024-10-18 05:32:12 +0200 |
| commit | 029b05219e895806ac58f794c138ae2a8197a7dc (patch) | |
| tree | 9f11c17eae36e92fe1719254fc5f3a90c57b5bcb /local | |
| parent | 0f4d7ab00e7b74d9deba92ef038f4fa53604ea24 (diff) | |
| download | dotfiles-029b05219e895806ac58f794c138ae2a8197a7dc.tar.gz dotfiles-029b05219e895806ac58f794c138ae2a8197a7dc.tar.bz2 dotfiles-029b05219e895806ac58f794c138ae2a8197a7dc.zip | |
Add screenshot-prompt script
Diffstat (limited to 'local')
| -rwxr-xr-x | local/bin/screenshot-prompt | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/local/bin/screenshot-prompt b/local/bin/screenshot-prompt new file mode 100755 index 0000000..7d4f1a7 --- /dev/null +++ b/local/bin/screenshot-prompt @@ -0,0 +1,35 @@ +#!/bin/sh + +set -e + +command -v scrot > /dev/null || + { echo "scrot not installed" ; exit 1 ; } +command -v rofi > /dev/null && + menu_exec='rofi -dmenu' || + menu_exec='dmenu' + +choice="$( +$menu_exec <<EOF +Crop to file +Crop to clipboard +Fullscreen to file +Fullscreen to clipboard +EOF +)" + +screenshot_dir="$HOME/screenshots" + +case "$choice" in + 'Crop to file') + scrot --select + ;; + 'Crop to clipboard') + scrot --select - | xclip -selection clipboard -target image/png + ;; + 'Fullscreen to file') + scrot + ;; + 'Fullscreen to clipboard') + scrot - | xclip -selection clipboard -target image/png + ;; +esac |
