From c375a15561a8862e7a9906a4a89f7bef3c989a51 Mon Sep 17 00:00:00 2001 From: Daniel Fainberg Date: Sat, 11 Jul 2026 14:01:04 +0200 Subject: [PATCH] feat(hyprland): swallow GUI windows spawned from foot into the terminal A viewer opened from a foot shell (zathura/imv, incl. from mc) now hides the terminal and takes its place, restoring it on close. Requires standalone foot: server/client mode shares one process across all windows, so PID-based swallow cannot tell them apart. `$mod+Return` runs `foot`, not `footclient`, and the `foot --server` exec-once is dropped. --- modules/home.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/home.nix b/modules/home.nix index d924489..a440f4e 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -504,6 +504,14 @@ in misc = { force_default_wallpaper = 0; disable_hyprland_logo = true; + # Window swallowing: a GUI spawned from a foot shell (e.g. zathura/imv + # from mc) hides the terminal and takes its place, restoring it on close. + # Matches on the *parent* terminal's class. Needs standalone foot: in + # server/client mode all windows share one process, so PID ancestry can't + # tell them apart and swallowing breaks — that's why $mod+Return runs + # `foot`, not `footclient`. + enable_swallow = true; + swallow_regex = "^(foot)$"; }; input = { @@ -522,7 +530,7 @@ in ]; bind = [ - "$mod, Return, exec, footclient" + "$mod, Return, exec, foot" "$mod, q, killactive" "$mod SHIFT, q, exit" "$mod, f, fullscreen, 1" @@ -563,11 +571,6 @@ in exec-once = [ "waybar" - # foot in server/daemon mode: $mod+Return runs `footclient`, which - # attaches to this one process → faster new-window startup, shared RAM. - # Uses foot's default socket, which footclient also defaults to. - # Tradeoff: if the server dies, all foot windows die with it. - "foot --server" # wallpaper (see modules/media.nix): start the awww daemon, then restore # the persisted choice. awww keeps no state across restarts, so re-push # the ~/.local/share/bg symlink if it exists.