me like nix
0

Configure Feed

Select the types of activity you want to include in your feed.

add claude code notify hook

author
Sean Aye
date (Mar 22, 2026, 8:03 PM -0400) commit c068d4f5 parent d114f55a change-id tlxzpoll
+27 -3
+23 -2
hosts/common/home.nix
··· 63 63 zjctl # Programmatic Zellij control 64 64 (pkgs.writeShellScriptBin "claude-notify" '' 65 65 PANE_ID="$ZELLIJ_PANE_ID" 66 + SESSION="$ZELLIJ_SESSION_NAME" 66 67 ( 67 68 ACTION=$(${pkgs.libnotify}/bin/notify-send "Claude Code" "Waiting for your approval" \ 68 69 --app-name=claude-code \ 69 70 --action=default=Open \ 70 71 --wait) 71 72 if [ "$ACTION" = "default" ]; then 72 - niri msg action focus-window --app-id Alacritty 73 + WIN_ID=$(niri msg windows | ${pkgs.gnugrep}/bin/grep -B1 "$SESSION" | ${pkgs.gnugrep}/bin/grep -oP '(?<=Window ID )\d+') 74 + if [ -n "$WIN_ID" ]; then 75 + niri msg action focus-window --id "$WIN_ID" 76 + fi 73 77 zjctl pane focus --pane "id:terminal:$PANE_ID" 74 78 fi 75 79 ) & ··· 547 551 }; 548 552 }; 549 553 load_plugins = { 550 - "file:${zrpc-wasm}/zrpc.wasm" = {}; 554 + "\"file:~/.config/zellij/plugins/zrpc.wasm\"" = {}; 551 555 }; 552 556 pane_frames = false; 553 557 show_startup_tips = false; 554 558 ui = { 555 559 pane_frames.hide_session_name = true; 556 560 }; 561 + }; 562 + }; 563 + 564 + xdg.configFile."zellij/plugins/zrpc.wasm".source = "${zrpc-wasm}/zrpc.wasm"; 565 + 566 + home.file.".claude/settings.json".text = builtins.toJSON { 567 + enabledPlugins = { 568 + "rust-analyzer-lsp@claude-plugins-official" = true; 569 + "typescript-lsp@claude-plugins-official" = true; 570 + }; 571 + hooks = { 572 + Notification = [ 573 + { 574 + matcher = "permission_prompt"; 575 + hooks = [{ type = "command"; command = "claude-notify"; }]; 576 + } 577 + ]; 557 578 }; 558 579 }; 559 580
+4 -1
packages/zjctl.nix
··· 8 8 9 9 src = pkgs.fetchurl { 10 10 url = "https://github.com/mrshu/zjctl/releases/download/v0.1.3/zjctl-x86_64-linux.tar.gz"; 11 - hash = "sha256-jtCvbfGg6hlzS9omUtiquATgLJbIsdz2yVVydzU+XV4="; 11 + hash = "sha256-2O4LfV9+pXbVew1yryE3SumrGQcR77r6tBs6uTHH1Sg="; 12 12 }; 13 13 14 14 sourceRoot = "."; 15 + 16 + nativeBuildInputs = [ pkgs.autoPatchelfHook ]; 17 + buildInputs = [ pkgs.gcc-unwrapped.lib ]; 15 18 16 19 installPhase = '' 17 20 install -Dm755 zjctl $out/bin/zjctl