#!/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