Been experimenting with Niri as my window manager for my dev environment. So far I'm blown away with how great it is for managing multiple git worktrees - so I made some scripts to manage workspaces so each worktree gets its own dedicated named workspace with your editor, terminal, and browser all launched/archived automatically.
I made some scripts I thought I'd share that take advantage of Niri's IPC to tie git worktrees directly to workspaces. The workflow is:
1. wk create - pick a remote branch or create a new one, and a worktree + Niri workspace spin up with your configured apps 2. wk list - fuzzy-find your active worktrees (sorted by last commit), see which ones have open workspaces, and focus/reopen/delete them 3. wk delete - either merge into your target branch and push, or archive - either way it cleans up the worktree, branch, and Niri workspace
Everything is driven by a single config file so you can set your repo, base branch, terminal, editor, browser, post-create commands (e.g. `pnpm install`), etc.
It also comes with a small `dev` companion script that kills processes on your configured ports before starting your dev server - useful when switching between worktrees that share the same ports.
Uses fzf for all the interactive bits. Requires Niri, fzf, jq, and git.
https://github.com/nskha101/niri-worktree-management
This is very much an early version of this based on my specific workflow I'll try to keep it updated as it evolves. Would love feedback, especially from anyone else using Niri or doing heavy worktree-based workflows.