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
15 lines
722 B
Bash
Executable File
15 lines
722 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# @vicinae.schemaVersion 1
|
|
# @vicinae.title Save Layout as Project
|
|
# @vicinae.mode silent
|
|
# @vicinae.icon ../../icons/hicolor/scalable/apps/panama-settings.svg
|
|
# @vicinae.description Record the windows you have open, and where, under a name.
|
|
# @vicinae.keywords ["project", "layout", "save", "session", "workspace"]
|
|
# @vicinae.argument1 { "type": "text", "placeholder": "project name" }
|
|
|
|
# Arrange the desktop, then name it. Capturing from the launcher rather than a
|
|
# settings page is the point: a layout is worth saving at the moment you have it
|
|
# right, and that moment is not one you want to interrupt by going looking for a
|
|
# page.
|
|
exec "$HOME/.config/quickshell/scripts/panama-project" save "$1"
|