From fb26c31776b8e783362fdbb73afff8d6c7664d40 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Sat, 26 Jul 2025 06:35:03 -0500 Subject: [PATCH] omp prompt for git-bug --- apps/nogui/oh-my-posh.nix | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/apps/nogui/oh-my-posh.nix b/apps/nogui/oh-my-posh.nix index 9d280c3..4e017c4 100644 --- a/apps/nogui/oh-my-posh.nix +++ b/apps/nogui/oh-my-posh.nix @@ -1,7 +1,7 @@ { pkgs, ... }: let unicode = x: builtins.fromJSON ''"${x}"''; - script = pkgs.writeShellApplication { + jjScript = pkgs.writeShellApplication { name = "jj-prompt"; runtimeInputs = [ pkgs.jujutsu ]; text = @@ -40,6 +40,16 @@ let ' ''; }; + gitBugScript = pkgs.writeShellApplication { + name = "git-bug-prompt"; + runtimeInputs = [ + pkgs.git-bug + pkgs.jq + ]; + text = '' + git-bug bug --format json status:open | jq 'length' + ''; + }; in { programs.oh-my-posh = { @@ -110,12 +120,23 @@ in foreground = "p:black"; powerline_symbol = unicode "\\ue0b0"; properties = { - script = "${script}/bin/jj-prompt"; + script = "${jjScript}/bin/jj-prompt"; }; style = "powerline"; template = "{{ if (glob \".jj\")}} {{ .Output }} {{ end }}"; type = "command"; } + { + background = "p:maroon"; + foreground = "p:black"; + powerline_symbol = unicode "\\ue0b0"; + properties = { + script = "${gitBugScript}/bin/git-bug-prompt"; + }; + style = "powerline"; + template = "{{ if (glob \".git/refs/bugs\")}} 󰃤 {{ .Output }} {{ end }}"; + type = "command"; + } { background = "p:blue"; background_templates = [ "{{ if gt .Code 0 }}p:red{{ end }}" ]; @@ -142,6 +163,7 @@ in lavender = "#B4BEFE"; orange = "#FAB387"; red = "#F38BA8"; + maroon = "#EBA0AC"; white = "#CDD6F4"; yellow = "#F9E2AF"; };