From a8e27ee9d32337a5886a335b8eb1b3cc0bc1e83c Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Wed, 18 Mar 2026 09:41:46 +0000 Subject: [PATCH] wip --- flake.lock | 6 ++-- home/common/programs/claude/default.nix | 7 +++++ home/common/programs/claude/settings.json | 5 +++ home/common/programs/claude/statusline.sh | 37 +++++++++++++++++++++++ home/common/programs/desktop/darkman.nix | 22 -------------- home/common/programs/yazi/default.nix | 1 + 6 files changed, 53 insertions(+), 25 deletions(-) create mode 100644 home/common/programs/claude/statusline.sh diff --git a/flake.lock b/flake.lock index 37baa31..6515772 100644 --- a/flake.lock +++ b/flake.lock @@ -904,11 +904,11 @@ "nvchad-starter": { "flake": false, "locked": { - "lastModified": 1771685994, - "narHash": "sha256-q/a7rhDRypv4p16mX40Vv1fW1Qg19BvPd6/UEb4nvqY=", + "lastModified": 1772536063, + "narHash": "sha256-LY+rHQkzM4HOihg+js0p9NxcnHQ2azvHLg+hezcJ1k0=", "owner": "naps62", "repo": "nvchad-starter", - "rev": "6b62931c5241e369c2c2d26f64ac6c3ba5108a60", + "rev": "a6caf577a18453fb5d4f627655d582b2553a9920", "type": "github" }, "original": { diff --git a/home/common/programs/claude/default.nix b/home/common/programs/claude/default.nix index 9826991..9d0a50c 100644 --- a/home/common/programs/claude/default.nix +++ b/home/common/programs/claude/default.nix @@ -11,6 +11,9 @@ bubblewrap socat libseccomp + + # voice + sox ]; # Commands @@ -43,6 +46,10 @@ home.file.".claude/skills/worktree-compare/SKILL.md".source = ./skills/worktree-compare/SKILL.md; home.file.".claude/skills/worktree-list/SKILL.md".source = ./skills/worktree-list/SKILL.md; + home.file.".claude/statusline.sh" = { + source = ./statusline.sh; + executable = true; + }; home.file.".claude/settings.json".source = ./settings.json; home.file.".claude/CLAUDE.md".source = ./CLAUDE.md; } diff --git a/home/common/programs/claude/settings.json b/home/common/programs/claude/settings.json index 413b1a2..0ccc65a 100644 --- a/home/common/programs/claude/settings.json +++ b/home/common/programs/claude/settings.json @@ -40,6 +40,7 @@ "release-assets.githubusercontent.com" ] }, + "voiceEnabled": true, "defaultMode": "acceptEdits", "feedbackSurveyState": { "lastShownTime": 1754052643456 @@ -54,5 +55,9 @@ "url": "https://mcp.linear.app/mcp" } }, + "statusLine": { + "type": "command", + "command": "~/.claude/statusline.sh" + }, "$schema": "https://json.schemastore.org/claude-code-settings.json" } diff --git a/home/common/programs/claude/statusline.sh b/home/common/programs/claude/statusline.sh new file mode 100644 index 0000000..eba2545 --- /dev/null +++ b/home/common/programs/claude/statusline.sh @@ -0,0 +1,37 @@ +#!/bin/bash +input=$(cat) + +# Extract values from JSON input +MODEL=$(echo "$input" | jq -r '.model.display_name // "Claude"') +DIR=$(echo "$input" | jq -r '.workspace.current_dir // "~"') +DIR_NAME="${DIR##*/}" +CONTEXT_USED=$(echo "$input" | jq -r '.context_window.used_percentage // 0') +COST=$(echo "$input" | jq -r '.cost.total_cost_usd // 0') + +# Get git repo root path (abbreviated with ~) and branch/PR info +GIT_INFO="" +REPO_PATH="" +if git -C "$DIR" rev-parse --git-dir > /dev/null 2>&1; then + REPO_ROOT=$(git -C "$DIR" rev-parse --show-toplevel 2>/dev/null) + # For worktrees, get the main repo root instead of the worktree path + MAIN_GIT_DIR=$(git -C "$DIR" rev-parse --git-common-dir 2>/dev/null) + if [ -n "$MAIN_GIT_DIR" ] && [[ "$MAIN_GIT_DIR" == /* ]]; then + REPO_ROOT=$(dirname "$MAIN_GIT_DIR") + fi + # Abbreviate ~/projects/ to p/ + REPO_PATH=" | ${REPO_ROOT/#$HOME\/projects\//p/}" + BRANCH=$(git -C "$DIR" branch --show-current 2>/dev/null) + if [ -n "$BRANCH" ]; then + PR_NUMBER=$(GIT_DIR="$DIR/.git" GIT_WORK_TREE="$DIR" gh pr view --json number -q '.number' 2>/dev/null) + if [ -n "$PR_NUMBER" ]; then + GIT_INFO=" | $BRANCH (#$PR_NUMBER)" + else + GIT_INFO=" | $BRANCH" + fi + fi +fi + +# Format cost +COST_FMT=$(printf "%.2f" "$COST") + +echo "YOLO$REPO_PATH$GIT_INFO | [$MODEL] | \$$COST_FMT | ${CONTEXT_USED}%" diff --git a/home/common/programs/desktop/darkman.nix b/home/common/programs/desktop/darkman.nix index ad52b34..cff85ff 100644 --- a/home/common/programs/desktop/darkman.nix +++ b/home/common/programs/desktop/darkman.nix @@ -24,10 +24,6 @@ # Update Hyprland cursor theme ${pkgs.hyprland}/bin/hyprctl setcursor Nordzy-cursors 24 ''; - kitty-theme = '' - # Reload kitty config to pick up noctalia theme changes - kill -SIGUSR1 $(pidof kitty) 2>/dev/null || true - ''; claude-theme = '' # Switch Claude Code to dark theme CLAUDE_CONFIG=~/.claude.json @@ -38,13 +34,6 @@ noctalia-theme = '' noctalia-shell ipc call darkMode setDark ''; - neovim-theme = '' - for sock in /run/user/$(id -u)/nvim.*.0; do - [ -S "$sock" ] && ${pkgs.neovim}/bin/nvim --server "$sock" \ - --remote-expr 'luaeval("require(\"theme-sync\").apply_theme(\"dark\")")' \ - 2>/dev/null || true - done - ''; }; lightModeScripts = { gtk-theme = '' @@ -64,10 +53,6 @@ # Update Hyprland cursor theme ${pkgs.hyprland}/bin/hyprctl setcursor Nordzy-white 24 ''; - kitty-theme = '' - # Reload kitty config to pick up noctalia theme changes - kill -SIGUSR1 $(pidof kitty) 2>/dev/null || true - ''; claude-theme = '' # Switch Claude Code to light theme CLAUDE_CONFIG=~/.claude.json @@ -78,13 +63,6 @@ noctalia-theme = '' noctalia-shell ipc call darkMode setLight ''; - neovim-theme = '' - for sock in /run/user/$(id -u)/nvim.*.0; do - [ -S "$sock" ] && ${pkgs.neovim}/bin/nvim --server "$sock" \ - --remote-expr 'luaeval("require(\"theme-sync\").apply_theme(\"light\")")' \ - 2>/dev/null || true - done - ''; }; }; diff --git a/home/common/programs/yazi/default.nix b/home/common/programs/yazi/default.nix index 716002e..08a1fff 100644 --- a/home/common/programs/yazi/default.nix +++ b/home/common/programs/yazi/default.nix @@ -7,6 +7,7 @@ { programs.yazi.enable = true; + programs.yazi.shellWrapperName = "y"; home.packages = with pkgs; [ yaziPlugins.git ];