diff options
author | mono-b <monoblanco@DRAINERDOMAIN.localdomain> | 2022-12-18 23:00:24 -0300 |
---|---|---|
committer | mono-b <monoblanco@DRAINERDOMAIN.localdomain> | 2022-12-18 23:00:24 -0300 |
commit | 0a043dbb7259cc59ac56b31573469f445a7921ed (patch) | |
tree | 28e87b1b7bbc035fbc467d5a7fc63204960dc247 /screenshots.sh |
up
Diffstat (limited to 'screenshots.sh')
-rwxr-xr-x | screenshots.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/screenshots.sh b/screenshots.sh new file mode 100755 index 0000000..00c31e4 --- /dev/null +++ b/screenshots.sh @@ -0,0 +1,28 @@ +#!/bin/sh + + +# Wal colors dmenu +. "${HOME}/.cache/wal/colors.sh" + +# Alias dmenu +alias give_to_dmenu='dmenu -c -nf "$color15" -nb "$color0" -sb "$color3" -sf "$color15" -fn "Iosevka-11"' + +# Vars +number_of_displays=$(xrandr | grep " connected" | wc -l) +main_menu_selection=$(printf "Fullscreen\nRegion" | give_to_dmenu -l 2 -p Capture:) + +# Menu +case $main_menu_selection in + "Fullscreen") + display_selection=$(xrandr | grep " connected" | awk '{print $1}' | give_to_dmenu -l $number_of_displays -p Display:) + screenshot_res=$(xrandr | grep "$display_selection" | grep -o '[[:digit:]]\+x[[:digit:]]\++[[:digit:]]\++[[:digit:]]\+') + screenshot_name=$(echo "" | give_to_dmenu -p Name:) + maim -g $screenshot_res -d 1 ~/stf/ss/"$screenshot_name.png" && dunstify " Screenshot taken" || dunstify "ERROR: Screenshot not taken" + ;; + "Region") + destination_selection=$(printf "SS\nShitposter" | give_to_dmenu -l 2 -p Destination:) + screenshot_name=$(echo "" | give_to_dmenu -p Name:) + [[ $destination_selection == SS ]] && destination=$SS_DIR || destination=$SHIT_DIR + maim -d 1 -s $destination/"$screenshot_name.png" && dunstify " Region screenshot taken" || dunstify "ERROR: Screenshot not taken" + ;; +esac |