diff options
| author | Rosa <rosaontheweb@proton.me> | 2026-05-02 18:14:47 -0400 |
|---|---|---|
| committer | Rosa <rosaontheweb@proton.me> | 2026-05-02 18:14:47 -0400 |
| commit | 4c469658f9a5d7b169a0267ef1849da7e42f2c87 (patch) | |
| tree | 2c36b7c31bf081d358b120ab015557374c5a4267 /modules/user/desktop/scripts | |
| parent | 674773e81d4f922c904fefee4a00cda6808f31a5 (diff) | |
move screenshot script to separate file
Diffstat (limited to 'modules/user/desktop/scripts')
| -rw-r--r-- | modules/user/desktop/scripts/screenshot.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/user/desktop/scripts/screenshot.sh b/modules/user/desktop/scripts/screenshot.sh new file mode 100644 index 0000000..f7d607b --- /dev/null +++ b/modules/user/desktop/scripts/screenshot.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# Bash screenshot script. Requires grim, slurp, sway, fuzzel, libnotify and jq. +IFS=$'\n' +screenshot_targets=$(swaymsg -rt get_outputs | jq -r '.[].name' | sort) +screenshot_targets+=($'\nSpecific region') # i LOVE bash +selected_target="$(printf '%s' "${screenshot_targets[@]}" | fuzzel --hide-prompt --mesg='What would you like to screenshot?' --mesg-mode=expand --minimal-lines --dmenu)" +outfile="$HOME/Pictures/Screenshots/$(date +'%F_%H.%M.%S.png')" + +send_notification() { + notify-send "Screenshot taken" "Screenshot saved to <b>$1</b>." +} + +case $selected_target in + 'Specific region') grim -g "$(slurp)" "$outfile" && send_notification "$outfile";; + *) grim -o "$selected_target" "$outfile" && send_notification "$outfile" ;; +esac |
