From 0a043dbb7259cc59ac56b31573469f445a7921ed Mon Sep 17 00:00:00 2001 From: mono-b Date: Sun, 18 Dec 2022 23:00:24 -0300 Subject: up --- screenshots.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 screenshots.sh (limited to 'screenshots.sh') 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 -- cgit v1.2.1