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

Loading…
Cancel
Save