Open the windows you open together, together

Arrange the desktop, run "Save Layout as Project" from the launcher, name it.
"Open Project" lays it out again on free workspaces, so it never lands on top of
what you are already doing. Saved layouts are listed on the Desktop settings
page, which is where they are removed.

Recorded rather than written by hand, and a terminal's directory is most of why
it is worth having: without it a project opens three terminals in your home
folder and you change directory three times. This machine had two terminals in
the same project when it was written, and reopening there is the difference
between a layout and a working desktop.

Four things had to be found by running it, none of which reading would have
shown.

A terminal's directory is not the terminal's working directory -- that is where
it was launched from. The shell inside it is what has been cd'd. Reading the
wrong one looked correct for exactly as long as the terminals under test had
been started from the right place, which they had.

gtk-launch cannot place a window. It activates over D-Bus, so the process
Hyprland started exits and a [workspace N silent] rule has nothing left to apply
to; Nautilus landed on whatever workspace was in front of you. The Exec line
from the desktop entry is run directly instead. But DBusActivatable
applications do the same thing regardless, so the window is found afterwards and
moved by address -- which also means a window that never appeared is reported
rather than assumed.

/proc/PID/task/PID/children is a file of pids, not a directory. Listing it as
one always raised, so the fast path was never once taken and everything went
through pgrep.

And kitty's --directory needs an equals sign or the short -d; the
space-separated long form is accepted and silently ignored.

The contract exercises a save and open round trip against a stubbed compositor,
and reads a terminal's directory out of a real process tree rather than grepping
the source for a shell name -- an earlier version passed against a helper that
had been changed back, because the constant was still there.

Claude-Session: https://claude.ai/code/session_01Q84axqUE5inJhf5Jz9CFy1
This commit is contained in:
Gabriel Brown
2026-08-21 13:45:16 -04:00
parent 538c0a887c
commit 185d7edaa5
8 changed files with 810 additions and 2 deletions
+14 -1
View File
@@ -101,7 +101,7 @@ docs/ Settings reference, and the design specs behind the work
## Tests
130 of them, under `tests/`. Run the lot, or a subset by pattern:
131 of them, under `tests/`. Run the lot, or a subset by pattern:
```sh
panama test # everything
@@ -123,6 +123,19 @@ tests/quickshell/ The shell and its settings pages
tests/hypr/ The compositor config
```
## Projects
A project is the set of windows you open together — which applications, which
workspace each was on, and for a terminal, which directory it was sitting in.
Arrange the desktop, then run **Save Layout as Project** from the launcher and
name it; **Open Project** lays it out again.
Workspaces are recorded as positions rather than numbers, and opening a project
claims free ones, so it never lands on top of what you are already doing. An
application that refuses to open twice — Slack, Thunderbird, the browser — is
moved into place rather than launched again. Saved layouts are listed on the
Desktop settings page, which is also where they are removed.
## The `panama` command
```sh