Browse Source

Fix last commit

pull/142/head
KKV9 2 years ago
parent
commit
909b48934f
  1. 21
      config/hypr/scripts/ScreenShot.sh

21
config/hypr/scripts/ScreenShot.sh

@ -19,19 +19,22 @@ notify_view() {
if [[ "$1" == "active" ]]; then
if [[ -e "${active_window_path}" ]]; then
${notify_cmd_shot} "Screenshot of '${active_window_class}' Saved."
paplay "${sDIR}/camera-shutter.oga"
else
${notify_cmd_shot} "Screenshot of '${active_window_class}' not Saved"
fi
elif [[ "$1" == "swappy" ]]; then
${notify_cmd_shot} "Screenshot Captured."
else
local check_file="$dir/$file"
if [[ -e "$check_file" ]]; then
${notify_cmd_shot} "Screenshot Saved."
paplay "${sDIR}/camera-shutter.oga"
else
${notify_cmd_shot} "Screenshot NOT Saved."
fi
fi
elif [[ "$1" == "swappy" ]]; then
${notify_cmd_shot} "Screenshot Captured."
}
@ -77,13 +80,6 @@ shotarea() {
notify_view
}
shotswappy() {
tmpfile=$(mktemp)
grim -g "$(slurp)" - >"$tmpfile" && paplay "${sDIR}/camera-shutter.oga" && notify_view "swappy"
swappy -f - <"$tmpfile"
rm "$tmpfile"
}
shotactive() {
active_window_class=$(hyprctl -j activewindow | jq -r '(.class)')
active_window_file="Screenshot_${time}_${active_window_class}.png"
@ -94,6 +90,13 @@ shotactive() {
notify_view "active"
}
shotswappy() {
tmpfile=$(mktemp)
grim -g "$(slurp)" - >"$tmpfile" && paplay "${sDIR}/camera-shutter.oga" && notify_view "swappy"
swappy -f - <"$tmpfile"
rm "$tmpfile"
}
if [[ ! -d "$dir" ]]; then
mkdir -p "$dir"

Loading…
Cancel
Save