Skip to content

wakame1367/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotfiles

WSL2 Ubuntu 24.04 + bash + chezmoi 前提で、WezTerm から Claude Code と Codex の進捗をタブ単位で見分けるための設定です。停止や入力待ちで BEL が鳴ると、そのタブだけ ● claude:repo / ● codex:repo の表示に変わります。

Managed Files

  • ~/.config/wezterm/wezterm.lua
  • ~/.config/wezterm/keys.lua
  • ~/.config/wezterm/ui.lua
  • ~/.config/wezterm/commands.lua
  • ~/.config/wezterm/domains.lua
  • ~/.config/bash/wezterm-agents.sh
  • ~/.local/bin/agent-bell.sh
  • ~/.claude/settings.json
  • ~/.codex/config.toml

Dependencies

  • Windows 側
    • WezTerm
    • winget
  • WSL2 Ubuntu 24.04 側
    • bash
    • Homebrew
    • chezmoi
    • lua5.4

補足:

  • WezTerm の設定ファイルは Lua ですが、通常運用では lua コマンド自体は不要です。
  • この repo ではローカル構文確認や将来の検証用に lua5.4 も bootstrap 対象に入れています。

Bootstrap

WSL 側は bootstrap-wsl.sh を使います。

cd ~/VSCode/dotfiles
chmod +x scripts/bootstrap-wsl.sh
./scripts/bootstrap-wsl.sh

このスクリプトは以下を行います。

  • Ubuntu パッケージ build-essential, procps, curl, file, git, lua5.4 を入れる
  • Homebrew を未導入ならインストールする
  • brew install chezmoi を実行する
  • chezmoi -S "$HOME/VSCode/dotfiles" apply を実行する

repo の場所が違う場合は REPO_DIR を渡します。

REPO_DIR=$HOME/src/dotfiles ./scripts/bootstrap-wsl.sh

注意:

  • apt-get update は既存の third-party PPA に依存します。
  • ubuntugis のように noble 非対応の source が残っていると bootstrap は失敗します。
  • その場合は対象の .list / .sources をユーザー側で無効化してから再実行してください。

Windows Install

Windows 側セットアップは WSL の bash からそのまま起動できます。

powershell.exe -ExecutionPolicy Bypass \
  -File "$(wslpath -w "$PWD/scripts/install-wezterm.ps1")" \
  -LinuxUser <your-linux-user>

このスクリプトは以下を行います。

  • winget install --id wez.wezterm --exact --source winget
  • %USERPROFILE%\.wezterm.lua に WSL 側設定を読む shim を作成

WSL ディストリ名が違う場合は -Distro を渡します。

powershell.exe -ExecutionPolicy Bypass \
  -File "$(wslpath -w "$PWD/scripts/install-wezterm.ps1")" \
  -Distro Ubuntu \
  -LinuxUser <your-linux-user>

Windows WezTerm Shim

Windows 版 WezTerm は通常 %USERPROFILE%\.wezterm.lua を読みます。WSL 側で管理している本体設定を読む薄い shim を Windows 側に置いてください。

local config_dir = [[\\\\wsl$\\Ubuntu\\home\\<your-linux-user>\\.config\\wezterm\\]]
package.path = table.concat({
  config_dir .. "?.lua",
  config_dir .. "?/init.lua",
  package.path,
}, ";")

local wsl_config = [[\\\\wsl$\\Ubuntu\\home\\<your-linux-user>\\.config\\wezterm\\wezterm.lua]]
return dofile(wsl_config)

WSL ディストリ名が Ubuntu 以外なら、UNC パスと domains.luapreferred を合わせて変更してください。 生成される shim は先に package.path を補正するため、UNC 越しでも keys.lua, ui.lua, domains.lua を読み込めます。

New Tabs

新規タブは WezTerm 内の bash から開きます。

wcc repo ~/work/repo
wcx repo ~/work/repo
  • wcc <name> <dir>claude:<name> タイトルの bash タブを開きます。
  • wcx <name> <dir>codex:<name> タイトルの bash タブを開きます。
  • どちらも指定ディレクトリで bash -l を開くだけなので、claude / codex 自体はそのタブで手動起動します。
  • 現在タブの表示名を変えたいときは wta <title> を使います。

Notifications

  • 通常表示は claude:repo / codex:repo です。
  • Claude Code の NotificationStop hook、Codex の notify~/.local/bin/agent-bell.sh を呼びます。
  • agent-bell.shprintf '\a' を送るだけなので、WezTerm の bell event が対象タブを要確認として記録します。
  • 非アクティブの要確認タブは ● claude:repo / ● codex:repo で表示されます。

Clear Attention

  • 要確認状態は、そのタブを選択すると自動で消えます。
  • タイトルそのものは保持されるので、確認後は claude:repo / codex:repo に戻ります。
  • wta は名前変更用です。要確認フラグの解除操作としては不要です。

Claude Hooks

~/.claude/settings.jsonNotificationStop の両方で agent-bell.sh を async 実行するテンプレートです。project 単位ではなくユーザー設定として配る前提です。

Codex Notify

~/.codex/config.toml は現行の notify = [...] を使います。Codex 側の停止通知は hooks 前提ではなく、完了時に agent-bell.sh を呼ぶ実運用テンプレートです。

5-Step Workflow

  1. WSL で ./scripts/bootstrap-wsl.sh を実行し、Homebrew / chezmoi / lua5.4 と dotfiles を適用する。
  2. WSL で powershell.exe -ExecutionPolicy Bypass -File "$(wslpath -w "$PWD/scripts/install-wezterm.ps1")" -LinuxUser <your-linux-user> を実行して WezTerm と shim を入れる。
  3. WezTerm を再起動し、WSL bash タブを開く。
  4. wcc repo ~/work/repo または wcx repo ~/work/repo で agent 用タブを作り、そのタブで claude / codex を起動する。
  5. 停止や入力待ちで ● claude:repo / ● codex:repo を確認し、タブを選んで解除する。

Sources

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors