From 64f83d4b598fee61e6b73345f5ab78e09e1ef5d2 Mon Sep 17 00:00:00 2001 From: postsolar <120750161+postsolar@users.noreply.github.com> Date: Wed, 10 Jan 2024 01:31:29 +0200 Subject: [PATCH 1/2] Fix Hyprland window ID detection PID reporting is not accurate, as it returns parent's PID. This would show up when running Foot terminal in server mode, where it would return the same PID (server's) for every client window. Using window address to identify the window fixes this. --- conf.d/done.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.d/done.fish b/conf.d/done.fish index 56fe789..071a7e6 100644 --- a/conf.d/done.fish +++ b/conf.d/done.fish @@ -83,7 +83,7 @@ function __done_get_focused_window_id and type -q jq swaymsg --type get_tree | jq '.. | objects | select(.focused == true) | .id' else if test -n "$HYPRLAND_INSTANCE_SIGNATURE" - hyprctl activewindow | awk 'NR==13 {print $2}' + hyprctl activewindow | awk 'NR==1 {print $2}' else if begin test "$XDG_SESSION_DESKTOP" = gnome; and type -q gdbus end From cf2067a03f741ebb187271bfdd88ea5ffca10c21 Mon Sep 17 00:00:00 2001 From: postsolar <120750161+postsolar@users.noreply.github.com> Date: Wed, 10 Jan 2024 01:45:41 +0200 Subject: [PATCH 2/2] Fix window ID equality checking for Hyprland Previous commit changed the way window ID is queried but didn't update equality checking bit --- conf.d/done.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.d/done.fish b/conf.d/done.fish index 071a7e6..f1fe25e 100644 --- a/conf.d/done.fish +++ b/conf.d/done.fish @@ -152,7 +152,7 @@ function __done_is_process_window_focused string match --quiet --regex "^true" (swaymsg -t get_tree | jq ".. | objects | select(.id == "$__done_initial_window_id") | .visible") return $status else if test -n "$HYPRLAND_INSTANCE_SIGNATURE" - and test $__done_initial_window_id -eq (hyprctl activewindow | awk 'NR==13 {print $2}') + and test $__done_initial_window_id = (hyprctl activewindow | awk 'NR==1 {print $2}') return $status else if test "$__done_initial_window_id" != "$__done_focused_window_id" return 1