diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-08-10 15:01:03 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-08-10 15:01:03 +0900 |
| commit | 4150ce25e87d8cbf3f067e6aabd8b1e836dbc683 (patch) | |
| tree | 1abf63413ad205728c29272f0f7d772c2476d8c7 | |
| parent | 16cb785971dda429fae4028c3b63de81e3c8f246 (diff) | |
| download | dotfiles-4150ce25e87d8cbf3f067e6aabd8b1e836dbc683.tar.gz dotfiles-4150ce25e87d8cbf3f067e6aabd8b1e836dbc683.tar.zst dotfiles-4150ce25e87d8cbf3f067e6aabd8b1e836dbc683.zip | |
claude: set up statusline
| -rw-r--r-- | .config/claude-code/settings.json | 5 | ||||
| -rwxr-xr-x | bin/__claude-code-notify | 2 | ||||
| -rwxr-xr-x | bin/__claude-code-statusline | 9 | ||||
| -rwxr-xr-x | bin/tmux-pane-idx | 2 | ||||
| -rw-r--r-- | home-manager/modules/common.nix | 1 |
5 files changed, 17 insertions, 2 deletions
diff --git a/.config/claude-code/settings.json b/.config/claude-code/settings.json index f066122..17d04eb 100644 --- a/.config/claude-code/settings.json +++ b/.config/claude-code/settings.json @@ -21,6 +21,11 @@ "Bash(git push:*)" ] }, + "statusLine": { + "type": "command", + "command": "__claude-code-statusline", + "padding": 0 + }, "hooks": { "Notification": [ { diff --git a/bin/__claude-code-notify b/bin/__claude-code-notify index 2d76b99..60d3454 100755 --- a/bin/__claude-code-notify +++ b/bin/__claude-code-notify @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash message="$(jq -r '.message // "Task completed"')" if [ "$(uname)" = "Darwin" ]; then diff --git a/bin/__claude-code-statusline b/bin/__claude-code-statusline new file mode 100755 index 0000000..2004db6 --- /dev/null +++ b/bin/__claude-code-statusline @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# https://docs.anthropic.com/en/docs/claude-code/statusline + +input="$(cat)" +cwd="$(echo "$input" | jq -r '.cwd')" +model="$(echo "$input" | jq -r '.model.display_name')" + +echo "[$model] ${cwd/#$HOME/\~}" diff --git a/bin/tmux-pane-idx b/bin/tmux-pane-idx index 7da534f..40a6184 100755 --- a/bin/tmux-pane-idx +++ b/bin/tmux-pane-idx @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Prints the tmux pane index. tmux display -pt "${TMUX_PANE:?}" '#{pane_index}' diff --git a/home-manager/modules/common.nix b/home-manager/modules/common.nix index f95df90..2e87b02 100644 --- a/home-manager/modules/common.nix +++ b/home-manager/modules/common.nix @@ -106,6 +106,7 @@ in "${nurpkgs.source-han-code-jp}/share/fonts/SourceHanCodeJP.ttc"; ".zshrc".source = ../config/zsh/.zshrc; "bin/__claude-code-notify".source = ../../bin/__claude-code-notify; + "bin/__claude-code-statusline".source = ../../bin/__claude-code-statusline; "bin/tmux-pane-idx".source = ../../bin/tmux-pane-idx; ".config/git/config".text = |
