Skip to content

fix: routine shell - #1490

Merged
shunkakinoki merged 10 commits into
mainfrom
fix-routine-shell
Apr 17, 2026
Merged

fix: routine shell#1490
shunkakinoki merged 10 commits into
mainfrom
fix-routine-shell

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Apr 17, 2026

Copy link
Copy Markdown
Owner
  • chore: streamline nvim
  • fix keychain (fix keychain #1479)
  • fix(xremap): Bypass Slack Framework+C copy remap
  • fix(input): Emit real Ctrl+C for Slack copy
  • chore: update
  • fix(hyprpanel): Copy writable runtime config
  • fix(uv-globals): Allow prerelease tool installs
  • chore(dotagents): Update submodule pointer
  • chore(dotagents): Update submodule pointer
  • feat(power): Add AC-only decafinate command

Summary by cubic

Adds an AC‑only “decafinate” keep‑awake tool, replaces tmuxinator with a built‑in tmux session bootstrap, fixes Slack copy by sending a real Ctrl+C, makes hyprpanel config writable at runtime, and hardens Nix format tasks.

  • New Features

    • decafinate: AC‑only systemd-inhibit session with a fish decaf wrapper and a rofi launcher; includes tests.
    • Built‑in tmux session bootstrap (__tmux_bootstrap_default_session) used by _tpo/_tmo/_tdo/_two/_tss; falls back from resurrect restore; tests added.
    • Allowlist prerelease uv tool installs via [tool.uv-globals].prerelease in pyproject.toml.
  • Bug Fixes

    • Slack/Electron copy: keyd maps Framework+C to Ctrl+C; xremap maps C-c → C-Shift-c for Ghostty to keep terminal copy behavior.
    • hyprpanel: activation copies JSON to ~/.config so the app can write config.json (no store symlink failures).
    • Neovim terminals: remove leader mappings from terminal mode; use Alt‑based bindings instead; tests verify no leader in terminal mode.
    • Makefile: add nixfmt fallback when nix fmt is unavailable and a safer cache clear; tests for host resolution.

Written for commit b5a91f0. Summary will update on new commits.

@mesa-dot-dev

mesa-dot-dev Bot commented Apr 17, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@coderabbitai

coderabbitai Bot commented Apr 17, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@shunkakinoki has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 51 minutes and 52 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 51 minutes and 52 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e87bd95e-01ae-4dfb-8c19-38be2923cc21

📥 Commits

Reviewing files that changed from the base of the PR and between 3b3489e and b5a91f0.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (17)
  • Makefile
  • config/hyprpanel/activate.sh
  • config/hyprpanel/default.nix
  • config/keyd/default.conf
  • config/rofi/default.nix
  • dotagents
  • home-manager/modules/local-scripts/decafinate.sh
  • home-manager/modules/local-scripts/default.nix
  • home-manager/modules/uv-globals/install-uv-globals.sh
  • home-manager/modules/xremap/default.nix
  • home-manager/programs/fish/default.nix
  • home-manager/programs/fish/functions/_decaf_function.fish
  • home-manager/programs/neovim/lua/config/keymaps.lua
  • home-manager/programs/neovim/tests/keymaps_spec.lua
  • pyproject.toml
  • spec/coverage_spec.sh
  • spec/fish/_decaf_function_test.fish
📝 Walkthrough

Walkthrough

This PR introduces power management functionality (decafinate service), refactors tmux session initialization from tmuxinator to built-in bootstrapping, adds shell aliases for clipboard operations, updates Makefile nix-build host resolution logic, and includes supporting configuration changes across multiple home-manager modules, tests, and dependencies.

Changes

Cohort / File(s) Summary
Makefile nix-build Darwin support
Makefile
Enhanced nix-build to select correct flake outputs based on NIXOS_NAMED_HOSTS and DETECTED_HOST, and improved nix-format with fallback to local nixfmt binary when native command fails.
Hyprpanel configuration activation
config/hyprpanel/activate.sh, config/hyprpanel/default.nix
Added activation script to idempotently manage hyprpanel JSON config; refactored module to use empty settings with runtime config generation and home-manager activation hooks.
Key mapping and remapping
config/keyd/default.conf, home-manager/modules/xremap/default.nix
Added Framework+C → Ctrl+C mapping in keyd, and added Ctrl+C → Ctrl+Shift+C mapping in xremap Ghostty layer.
Rofi desktop entry
config/rofi/default.nix
Updated module signature to accept config and added decafinate desktop entry with battery icon and system category.
Decafinate power management
home-manager/modules/local-scripts/decafinate.sh, home-manager/modules/local-scripts/default.nix
Added new bash script to manage systemd "keep-awake" service with AC power detection and user-level systemd-inhibit integration.
Shell alias additions
home-manager/programs/bash/default.nix, home-manager/programs/fish/default.nix, home-manager/programs/zsh/default.nix
Added copy/paste aliases mapping to clipboard-copy/clipboard-paste across bash, fish, and zsh shells.
Fish shell enhancements
home-manager/programs/fish/functions/\_decaf_function.fish, home-manager/programs/fish/functions/__tmux_bootstrap_default_session.fish, home-manager/programs/fish/functions/_tdo_function.fish, home-manager/programs/fish/functions/_tmo_function.fish, home-manager/programs/fish/functions/_tpo_function.fish, home-manager/programs/fish/functions/_tss_function.fish, home-manager/programs/fish/functions/_two_function.fish
Introduced tmux session bootstrapping without tmuxinator: new __tmux_bootstrap_default_session function creates default sessions, and refactored _tpo/_tmo/_tdo/_two/_tss functions to use bootstrapping instead of tmuxinator with explicit session/window setup and attach/switch logic.
Fish configuration updates
home-manager/programs/fish/default.nix
Added decaf abbreviation and copy alias; registered new fish functions _decaf_function and __tmux_bootstrap_default_session; reordered function list.
Neovim terminal keybindings
home-manager/programs/neovim/lua/config/keymaps.lua
Changed leader-based terminal controls to normal-mode only and added Meta-key bindings (<M-u/h/j/n/p>) for terminal management with added safety comment.
Neovim keymap testing
home-manager/programs/neovim/tests/keymaps_spec.lua
Added test suite "terminal leader safety" asserting no leader bindings in terminal mode and verifying Alt-based terminal controls present.
UV tool globals configuration
home-manager/modules/uv-globals/install-uv-globals.sh, pyproject.toml
Added conditional --prerelease=allow support via [tool.uv-globals].prerelease list; configured serena-agent as prerelease tool.
Submodule and dependency updates
dotagents, package.json
Updated dotagents submodule pointer and bumped multiple scoped/unscoped package versions in package.json.
Test coverage and new specs
spec/coverage_spec.sh, spec/make_build_host_resolution_spec.sh, spec/fish/__tmux_bootstrap_default_session_test.fish, spec/fish/_decaf_function_test.fish, spec/fish/_tdo_function_test.fish, spec/fish/_tmo_function_test.fish, spec/fish/_tpo_function_test.fish, spec/fish/_tss_function_test.fish, spec/fish/_two_function_test.fish, spec/llm_update_spec.sh
Added new shellspec for Makefile host resolution, comprehensive fishtape tests for new/refactored fish functions covering tmux bootstrapping and decafinate, updated coverage list, and modified llm-update test logic.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • feat(tmux): session logging, pane archive, and tmuxinator integration #926: Modifies tmux-related fish functions (_tpo/_tmo/_tdo/_two/_tss) to refactor tmuxinator integration, directly overlapping with the tmux bootstrapping changes in this PR.
  • fix keychain #1479: Updates Makefile Darwin nix-build host-resolution logic and introduces the same home-manager fish functions/bootstrapping changes plus shell alias updates, indicating substantial code-level overlap.
  • fix kolide #1475: Modifies Makefile host-resolution and host-target logic for named hosts, relating to the nix-build flake output selection changes in this PR.

Suggested labels

bug

Poem

🐰 Bouncing through configs with tmux delight,
Keeping laptops awake when power's tight,
Clipboard commands and keybinds so neat,
Bootstrap sessions—no tmuxinator's beat!
Tests verify all, from fish to the shell,
This dotfile refresh works wonderfully well! 🌟

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'fix: routine shell' is vague and does not accurately summarize the main changes in this comprehensive PR that includes new features (decafinate, tmux bootstrap), bug fixes (Slack copy, hyprpanel config, neovim terminal modes, Makefile Darwin builds), and numerous quality-of-life improvements across multiple systems. Use a more descriptive title that captures the primary scope, such as 'chore: add decafinate power tool and tmux bootstrap with shell/keybind fixes' or break into focused PRs by feature/domain.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description effectively summarizes the PR's scope through a structured list of changes and a cubic-generated summary covering new features (decafinate, tmux bootstrap, prerelease UV tools, copy/paste aliases), bug fixes (Slack copy, hyprpanel config, neovim terminals, Makefile Darwin builds), and includes test coverage details.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-routine-shell

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mesa-dot-dev

mesa-dot-dev Bot commented Apr 17, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Adds an AC-only "decafinate" keep-awake tool, streamlines tmux session bootstrapping, fixes Slack/Electron copy issues, makes hyprpanel config writable, and improves Nix format task robustness.

What changed?

  • Makefile: Hardened Nix formatting with nixfmt fallback and safer nix-format-clear-cache operation.
  • config/hyprpanel/activate.sh: New script to atomically deploy or update hyprpanel's config.json to $HOME/.config, handling symlinks and permissions.
  • config/hyprpanel/default.nix: Refactored hyprpanel configuration to generate settings into a JSON file and use an home.activation script for deployment, resolving write issues with symlinked configs.
  • config/keyd/default.conf: Added a keybinding to map Framework+C directly to Ctrl+C for improved Slack/Electron compatibility.
  • config/rofi/default.nix: Integrated a new decafinate entry into Rofi's drun.extra applications for launching the keep-awake script.
  • dotagents: Updated generated agent configuration or definitions (submodule pointer).
  • home-manager/modules/local-scripts/decafinate.sh: Introduced a new AC-only systemd-inhibit keep-awake utility script with start, stop, toggle, and status commands, and desktop notifications.
  • home-manager/modules/local-scripts/default.nix: Included the decafinate.sh script, managed by Home Manager and placed in ~/.local/scripts/decafinate.
  • home-manager/modules/uv-globals/install-uv-globals.sh: Updated script to allow prerelease uv tool installs for packages specified in pyproject.toml.
  • home-manager/modules/xremap/default.nix: Added a new xremap configuration for Ghostty to remap C-c to C-Shift-c, standardizing copy behavior and preventing SIGINT.
  • home-manager/programs/fish/default.nix: Added a new decaf alias and its corresponding _decaf_function to the fish shell configuration.
  • home-manager/programs/fish/functions/_decaf_function.fish: New Fish shell function to execute the decafinate script for keeping the laptop awake on AC power.
  • home-manager/programs/neovim/lua/config/keymaps.lua: Updated Neovim terminal keybindings, removing leader mappings from terminal mode and adopting Alt-based bindings.
  • home-manager/programs/neovim/tests/keymaps_spec.lua: Added tests to verify that Neovim terminal mode keymaps do not use leader-prefixed mappings.
  • pyproject.toml: Updated serena-agent version and added [tool.uv-globals] section to allow prerelease installations of serena-agent.
  • spec/coverage_spec.sh: Updated coverage specification to include config/hyprpanel/activate.sh and home-manager/modules/local-scripts/decafinate.sh.
  • spec/fish/_decaf_function_test.fish: New test file to verify the failure behavior of _decaf_function when dependencies are missing.

Description generated by Mesa. Update settings

shunkakinoki and others added 9 commits April 17, 2026 17:23
Slack was still misreading the synthesized Hyper-to-Ctrl copy path on Wayland and could trigger its unread behavior instead of a clean copy action.

Route Framework+C through the Slack-specific xremap override and hand the copy chord off to the Nix-pinned wtype binary after a short delay so the app sees a clean Ctrl+C.

Co-authored-by: Codex <noreply@openai.com>
Wire Framework+C directly to Ctrl+C in keyd so Slack sees the same chord as a physical copy shortcut instead of the synthetic Hyper-to-Ctrl remap path.

Keep terminal copy working by teaching the Ghostty xremap override to translate C-c into Ctrl+Shift+C.

Co-authored-by: Codex <noreply@openai.com>
Replace the store-backed config symlink with an activation-time copy so
HyprPanel can write back to config.json at runtime without failing on
symlink-safe file opens.

Co-authored-by: Codex <noreply@openai.com>
Add a prerelease allowlist for uv global tools so packages like
serena-agent can be installed without weakening version handling for the
rest of the tool set.

Co-authored-by: Codex <noreply@openai.com>
Advance dotagents to the local MCP hydration update so the parent repo
captures the committed submodule state.

Co-authored-by: Codex <noreply@openai.com>
Add a shared decafinate script that starts an inhibit session only
while AC power is connected and exposes it through the fish decaf
wrapper plus a rofi launcher entry.

Keep the requested shell gates green by covering the new script and fish
wrapper in shell tests, fixing the tmux fishtape assertions, and adding
an offline nixfmt fallback so make format still works when nix fmt
cannot resolve cache inputs.

Co-authored-by: Codex <noreply@openai.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a decafinate script for AC-powered sleep inhibition, refactors hyprpanel configuration to allow runtime updates, and replaces tmuxinator with a native Fish-based session bootstrap. Neovim terminal keybindings were updated to Alt-based mappings to prevent shell input interference, and uv tool installation now supports prerelease packages. Feedback highlights opportunities to remove redundant formatting commands in the Makefile, ensure correct tmux restoration by reordering script lookups, and reduce overhead in the decafinate service by avoiding unnecessary login shells.

I am having trouble creating individual review comments. Click here to see my feedback.

home-manager/programs/fish/functions/_two_function.fish (11-19)

high

The restore script path is currently looked up before ensuring that a tmux server is running. If no server is active, tmux list-keys will fail, resulting in an empty restore variable. Consequently, the function will skip the restoration logic even if the resurrect plugin is available once the server is started. Moving the lookup after the server bootstrap ensures the script path is correctly identified.

  set -l bootstrapped 0

  # Start a server if needed so we can invoke the restore script.
  if not tmux list-sessions 2>/dev/null | grep -q .
    tmux new-session -d -s _bootstrap
    set bootstrapped 1
  end

  set -l restore (tmux list-keys 2>/dev/null | string match -rg '(/\S+/resurrect/scripts/restore\.sh)')
  set -l restore $restore[1]

Makefile (522)

medium

The nix-format target currently depends on nix-format-clear-cache, which executes $(NIX_EXEC) fmt -- --clear-cache. The body of nix-format then executes the exact same command again. Since nix fmt -- --clear-cache both clears the cache and performs the formatting, this dependency results in redundant execution. Removing the dependency streamlines the process.

nix-format: ## Format Nix files.

home-manager/modules/local-scripts/decafinate.sh (105)

medium

Using a login shell (-lc) within the transient systemd unit is unnecessary and adds overhead. The script block provided to bash is self-contained (it even redefines the ac_online function) and systemd already provides a suitable environment for user units (including $HOME). A standard non-login shell execution is more robust and efficient here.

"$bash_bin" -c '

@shunkakinoki
shunkakinoki merged commit 92f6830 into main Apr 17, 2026
5 checks passed
@shunkakinoki
shunkakinoki deleted the fix-routine-shell branch April 17, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant