|
15 | 15 | # which leaves orphans if the compositor crashes and re-runs). |
16 | 16 | home.packages = [pkgs.walker pkgs.elephant]; |
17 | 17 |
|
| 18 | + # Niri session definitions. Triggered from walker → "Current Layout". |
| 19 | + # Uses proportional column widths so it survives monitor swaps. |
| 20 | + # Workspace 1: Brave (≈70%) + Ghostty (≈30%) side by side. |
| 21 | + xdg.configFile."elephant/nirisessions.toml".text = '' |
| 22 | + [[sessions]] |
| 23 | + name = "Daily" |
| 24 | +
|
| 25 | + [[sessions.workspaces]] |
| 26 | + # Brave (70%) + Ghostty (30%) side by side. After all windows spawn, |
| 27 | + # focus the first column so Brave is active. |
| 28 | + # Commands wrapped in `systemd-run --user --no-block --collect --` so |
| 29 | + # each spawn becomes a child of systemd user manager, not elephant. |
| 30 | + # This makes them survive `systemctl --user restart elephant walker`. |
| 31 | + windows = [ |
| 32 | + { command = "systemd-run --user --no-block --collect -- brave-origin", app_id = "brave-origin", after = [ |
| 33 | + "niri msg action set-column-width '70%'", |
| 34 | + ] }, |
| 35 | + { command = "systemd-run --user --no-block --collect -- ghostty", app_id = "com.mitchellh.ghostty", after = [ |
| 36 | + "niri msg action set-column-width '30%'", |
| 37 | + ] }, |
| 38 | + ] |
| 39 | + after = [ |
| 40 | + "niri msg action focus-column-first", |
| 41 | + ] |
| 42 | + ''; |
| 43 | + |
| 44 | + # Elephant config — restrict which providers get loaded into memory. |
| 45 | + # Each provider indexed costs roughly 10-25 MB resident; trimming the |
| 46 | + # full auto-load set down to three cuts elephant's working set by |
| 47 | + # ~80-120 MB. |
| 48 | + # KEEP: desktopapplications (core grid), windows (alt-tab style focus), |
| 49 | + # nirisessions (saved layouts). Drop the rest. |
| 50 | + xdg.configFile."elephant/elephant.toml".text = '' |
| 51 | + # Wrap every spawn in a systemd transient service unit so launched apps |
| 52 | + # survive walker/elephant daemon restarts. Service mode (no --scope) |
| 53 | + # detaches the process from the launcher entirely; --no-block returns |
| 54 | + # immediately, --collect garbage-collects the unit after the app exits. |
| 55 | + launch_prefix = "systemd-run --user --no-block --collect --" |
| 56 | +
|
| 57 | + ignored_providers = [ |
| 58 | + "providerlist", |
| 59 | + "niriactions", |
| 60 | + "wireplumber", |
| 61 | + "symbols", |
| 62 | + "playerctl", |
| 63 | + "unicode", |
| 64 | + "clipboard", |
| 65 | + "bluetooth", |
| 66 | + "snippets", |
| 67 | + "websearch", |
| 68 | + "bookmarks", |
| 69 | + "archlinuxpkgs", |
| 70 | + "runner", |
| 71 | + "calc", |
| 72 | + "todo", |
| 73 | + "files", |
| 74 | + ] |
| 75 | + ''; |
| 76 | + |
18 | 77 | systemd.user.services.elephant = { |
19 | 78 | Unit = { |
20 | 79 | Description = "Elephant data backend for the Walker launcher"; |
|
0 commit comments