Add Kando pie menu of cursor-following popups and aichat quick role

Replace cursor_ask.sh with popup.sh launching popups from a Kando
"popups" menu; cursor_follow.lua gains a popups table (sizes, follow
until Enter, stay_focused) and pauses following while Kando is open.
Add aichat config/role for the quick Claude popup and Kando
menu/theme configs, with gen-colors syncing the Kando theme palette.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-26 12:23:01 +00:00
co-authored by Claude Opus 5.5
parent 2f5a53595d
commit c00705a24a
15 changed files with 653 additions and 255 deletions
+19 -1
View File
@@ -8,7 +8,10 @@ This is a dotfiles/config repository for Arch Linux (Manjaro) using `yay` as the
## Repository Structure
- **Window managers**: `hyprland/`, `sway/`, `i3/` - config files for each WM
- **Window managers**: `hypr/`, `sway/`, `i3/` - config files for each WM
- **Hyprland cursor follow + popups**: `hypr/cursor_follow.lua` (required from `base.lua`) keeps a floating window glued beside the mouse cursor (PiP videos, `$mod+z`) and handles the `$mod+a` popups: the `popups` table maps window classes to sizes and whether they follow until Enter is pressed (a `non_consuming` Return bind pauses them; `stay_focused` holds keyboard focus while following, since `follow_mouse = 1`). Opening the Kando menu also pauses a following popup and hands focus to the menu, since the menu needs the keyboard to see SUPER released. `hypr/popup.sh <name>` launches each popup. It also starts Kando on `hyprland.start` and keeps xpad sticky notes in `special:scratchpad`
- **Pie menu**: `kando/menus.json` (the `popups` menu, items run `popup.sh`) and `kando/config.json` (theme), file-symlinked into `~/.config/kando` (the rest of that dir is Kando runtime state). Kando writes settings-window edits through the symlinks, and watches the files, so edits here apply live. Its Hyprland shortcut ID is `kando:popups` (`hl.dsp.global("kando:popups")`); the launcher needs `KANDO_OZONE_PLATFORM=wayland`, otherwise it runs under XWayland
- **AI popups**: `hypr/aichat/config.yaml` (model `claude:claude-haiku-5-5`, `repl_prelude: temp:quick`, thinking disabled via `patch` so no empty `<think>` block) and `hypr/aichat/roles/quick.md` (short answers; code requests get library + functions until asked for the code). `popup.sh` sets `AICHAT_CONFIG_FILE`/`AICHAT_ROLES_DIR`; the API key is only in `~/.config/aichat/.env` as `CLAUDE_API_KEY` — never put it in the repo (`.env` is gitignored)
- **KDE Plasma (Steam Deck)**: `kde/` - `apply.sh` installs Krohnkite and runs `shortcuts.py`, which sets Hyprland-style global shortcuts live via kglobalaccel D-Bus (don't hand-edit `kglobalshortcutsrc`; edit the `BINDINGS` table). Avoid `KGlobalAccel.globalShortcutsByKey` over D-Bus because a malformed call crashes kwin_wayland
- **Waybar**: `waybar/` - separate config JSONs per WM (`waybar_hyprland_config.json`, `waybar_sway_config.json`) plus shared `waybar_style.css`
- **Shell**: `bashrc`, `zshrc` - sourced from the user's dotfiles, not used directly
@@ -28,6 +31,10 @@ Some configs are built by concatenating a `colors.*` file with a `base.*` file.
After editing a base file, run the corresponding `build.sh` to regenerate the output.
`colors.conf` is the single palette; `sh/gen-colors` writes the `colors.*` fragments and also rewrites `menuThemeColors.purity` in the tracked `kando/config.json` (in place, to keep the symlink).
`hypr/cursor_follow.lua` and `hypr/popup.sh` are not built: `hyprctl reload` picks up Lua changes (then check `hyprctl configerrors`), and `popup.sh` / the aichat files are read on each launch.
## Key Conventions
- Configs are symlinked into `~/.config/` (see README.md for exact symlink commands per component)
@@ -36,3 +43,14 @@ After editing a base file, run the corresponding `build.sh` to regenerate the ou
- Hyprland is the primary/active WM (most recent changes)
- `$mod` in WM configs refers to the Super/Windows key
- Keybindings use vim-style hjkl navigation across all WMs and tmux
- When adding a package dependency, add it to `packages.txt`
- Prefer existing programs over custom scripts for popups and tools (the user asked for this)
## Working on the live Hyprland session
- The config is Lua (Hyprland 0.56). `hyprctl dispatch` takes a Lua expression, so module functions can be called directly: `hyprctl dispatch 'require("cursor_follow").toggle_sticky'`. Window props: `hyprctl getprop address:<addr> stay_focused`. Shortcuts registered by apps: `hyprctl globalshortcuts`
- The user is usually at the desktop. Anything that opens a window takes their keyboard (the following popups even lock it with `stay_focused`), so don't open popups to test them while they may be typing. To check a mouse popup's class and rules without stealing focus, launch it on a hidden workspace and close it afterwards: `hyprctl dispatch 'hl.dsp.exec_cmd("pavucontrol", { workspace = "special:probe silent" })'`
- Chromium ignores `--class` for `--app` windows on Wayland; their class comes from the URL (e.g. `chrome-127.0.0.1__-Default`), which is what the `popups` table matches for the receipt printer page
- To try something that may crash Hyprland, run a nested one on a hidden workspace and drive it with `hyprctl -i <instance>` (its dir appears in `$XDG_RUNTIME_DIR/hypr`; clients spawned with its `exec_cmd` open inside it): `hyprctl dispatch 'hl.dsp.exec_cmd("env HYPRLAND_NO_SD_VARS=1 HYPRLAND_NO_SD_NOTIFY=1 Hyprland --config /path/test.lua", { workspace = "special:probe silent" })'`. Its crash reports also land in `~/.cache/hyprland`
- Hyprland 0.56 bug: a pinned window sent to a hidden workspace (silent move) keeps its layout there once it's focused, and floating or tiling it after that workspace is destroyed segfaults (`CSpace::toggleTargetFloating`). So `$mod+CTRL+N` unpins before moving; don't silently move pinned windows elsewhere
- aichat's REPL (reedline) waits for a reply to cursor-position queries, so it hangs under `script`; drive it with a pty that answers `\e[6n` (or test one-shot `aichat -r quick "..." </dev/null`, which needs stdin closed)