From 4150ce25e87d8cbf3f067e6aabd8b1e836dbc683 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 10 Aug 2025 15:01:03 +0900 Subject: claude: set up statusline --- bin/__claude-code-notify | 2 +- bin/__claude-code-statusline | 9 +++++++++ bin/tmux-pane-idx | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100755 bin/__claude-code-statusline (limited to 'bin') 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}' -- cgit v1.2.3-70-g09d2