From 3b48fe0a79420b373a92fd317e380145f68e2338 Mon Sep 17 00:00:00 2001 From: Myned Date: Sun, 13 Oct 2024 17:16:02 -0500 Subject: [PATCH] window: add ability to reset state Signed-off-by: Myned --- options/custom/scripts/window.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/options/custom/scripts/window.sh b/options/custom/scripts/window.sh index 4fe350b..e949b0d 100644 --- a/options/custom/scripts/window.sh +++ b/options/custom/scripts/window.sh @@ -24,6 +24,13 @@ move() { # Get current position position="$(hyprctl -j clients | jq -r ".[] | select(.${argc_property:-} | test(\"${argc_window:-}\")).at")" # [X,Y] + # Clear saved position if window does not exist + if ! [[ "$position" ]]; then + rm --force "${argc_file:-}" + notify-send "> window" "Cleared saved position" --urgency low + exit + fi + if [[ "${argc_current:-}" ]]; then if [[ -f "${argc_file:-}" ]]; then # Pop saved position