From e382533de0518a547e587d23d10e46a8daf49324 Mon Sep 17 00:00:00 2001 From: betaboon Date: Sat, 21 Dec 2024 14:08:03 +0100 Subject: [PATCH 1/3] Make nix-shell indicator configurable --- defaults.go | 21 ++++++++++++--------- segment-nix-shell.go | 2 +- themes.go | 7 ++++--- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/defaults.go b/defaults.go index 83c91ad1..2a0dc850 100644 --- a/defaults.go +++ b/defaults.go @@ -83,9 +83,10 @@ var defaults = Config{ RepoConflicted: "\u273C", RepoStashed: "\u2691", - VenvIndicator: "\uE235", - NodeIndicator: "\u2B22", - RvmIndicator: "\uE92B", + NixShellIndicator: "\uF313", + NodeIndicator: "\u2B22", + RvmIndicator: "\uE92B", + VenvIndicator: "\uE235", }, "patched": { Lock: "\uE0A2", @@ -106,9 +107,10 @@ var defaults = Config{ RepoConflicted: "\u273C", RepoStashed: "\u2691", - VenvIndicator: "\uE235", - NodeIndicator: "\u2B22", - RvmIndicator: "\uE92B", + NixShellIndicator: "\uF313", + NodeIndicator: "\u2B22", + RvmIndicator: "\uE92B", + VenvIndicator: "\uE235", }, "flat": { RepoDetached: "\u2693", @@ -120,9 +122,10 @@ var defaults = Config{ RepoConflicted: "\u273C", RepoStashed: "\u2691", - VenvIndicator: "\uE235", - NodeIndicator: "\u2B22", - RvmIndicator: "\uE92B", + NixShellIndicator: "\uF313", + NodeIndicator: "\u2B22", + RvmIndicator: "\uE92B", + VenvIndicator: "\uE235", }, }, Shells: ShellMap{ diff --git a/segment-nix-shell.go b/segment-nix-shell.go index af2ad1cd..44390457 100644 --- a/segment-nix-shell.go +++ b/segment-nix-shell.go @@ -13,7 +13,7 @@ func segmentNixShell(p *powerline) []pwl.Segment { } return []pwl.Segment{{ Name: "nix-shell", - Content: "\uf313", + Content: p.symbols.NixShellIndicator, Foreground: p.theme.NixShellFg, Background: p.theme.NixShellBg, }} diff --git a/themes.go b/themes.go index f52c9891..057a2b30 100644 --- a/themes.go +++ b/themes.go @@ -20,9 +20,10 @@ type SymbolTemplate struct { RepoConflicted string RepoStashed string - VenvIndicator string - NodeIndicator string - RvmIndicator string + NixShellIndicator string + NodeIndicator string + RvmIndicator string + VenvIndicator string } // Theme definitions From b0afb1e705c51fe4b48feb7f694b114ee3c93e75 Mon Sep 17 00:00:00 2001 From: betaboon Date: Sat, 21 Dec 2024 14:20:23 +0100 Subject: [PATCH 2/3] Make kube indicator configurable --- defaults.go | 3 +++ segment-kube.go | 5 ++--- themes.go | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/defaults.go b/defaults.go index 2a0dc850..36da254c 100644 --- a/defaults.go +++ b/defaults.go @@ -83,6 +83,7 @@ var defaults = Config{ RepoConflicted: "\u273C", RepoStashed: "\u2691", + KubeIndicator: "\u2388", NixShellIndicator: "\uF313", NodeIndicator: "\u2B22", RvmIndicator: "\uE92B", @@ -107,6 +108,7 @@ var defaults = Config{ RepoConflicted: "\u273C", RepoStashed: "\u2691", + KubeIndicator: "\u2388", NixShellIndicator: "\uF313", NodeIndicator: "\u2B22", RvmIndicator: "\uE92B", @@ -122,6 +124,7 @@ var defaults = Config{ RepoConflicted: "\u273C", RepoStashed: "\u2691", + KubeIndicator: "\u2388", NixShellIndicator: "\uF313", NodeIndicator: "\u2B22", RvmIndicator: "\uE92B", diff --git a/segment-kube.go b/segment-kube.go index 5a28663a..6f775deb 100644 --- a/segment-kube.go +++ b/segment-kube.go @@ -1,7 +1,6 @@ package main import ( - "fmt" pwl "github.com/justjanne/powerline-go/powerline" "io/ioutil" "os" @@ -113,7 +112,7 @@ func segmentKube(p *powerline) []pwl.Segment { kubeIconHasBeenDrawnYet = true segments = append(segments, pwl.Segment{ Name: "kube-cluster", - Content: fmt.Sprintf("⎈ %s", cluster), + Content: p.symbols.KubeIndicator + " " + cluster, Foreground: p.theme.KubeClusterFg, Background: p.theme.KubeClusterBg, }) @@ -122,7 +121,7 @@ func segmentKube(p *powerline) []pwl.Segment { if namespace != "" { content := namespace if !kubeIconHasBeenDrawnYet { - content = fmt.Sprintf("⎈ %s", content) + content = p.symbols.KubeIndicator + " " + content } segments = append(segments, pwl.Segment{ Name: "kube-namespace", diff --git a/themes.go b/themes.go index 057a2b30..e8101d67 100644 --- a/themes.go +++ b/themes.go @@ -20,6 +20,7 @@ type SymbolTemplate struct { RepoConflicted string RepoStashed string + KubeIndicator string NixShellIndicator string NodeIndicator string RvmIndicator string From 0223f298f7c3ba14d644fc8addad968a5d626773 Mon Sep 17 00:00:00 2001 From: betaboon Date: Sat, 21 Dec 2024 14:23:30 +0100 Subject: [PATCH 3/3] Make dotenv indicator configurable --- defaults.go | 3 +++ segment-dotenv.go | 2 +- themes.go | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/defaults.go b/defaults.go index 36da254c..ba71d158 100644 --- a/defaults.go +++ b/defaults.go @@ -83,6 +83,7 @@ var defaults = Config{ RepoConflicted: "\u273C", RepoStashed: "\u2691", + DotEnvIndicator: "\u2235", KubeIndicator: "\u2388", NixShellIndicator: "\uF313", NodeIndicator: "\u2B22", @@ -108,6 +109,7 @@ var defaults = Config{ RepoConflicted: "\u273C", RepoStashed: "\u2691", + DotEnvIndicator: "\u2235", KubeIndicator: "\u2388", NixShellIndicator: "\uF313", NodeIndicator: "\u2B22", @@ -124,6 +126,7 @@ var defaults = Config{ RepoConflicted: "\u273C", RepoStashed: "\u2691", + DotEnvIndicator: "\u2235", KubeIndicator: "\u2388", NixShellIndicator: "\uF313", NodeIndicator: "\u2B22", diff --git a/segment-dotenv.go b/segment-dotenv.go index 2e5344fb..1b9aae5c 100644 --- a/segment-dotenv.go +++ b/segment-dotenv.go @@ -21,7 +21,7 @@ func segmentDotEnv(p *powerline) []pwl.Segment { } return []pwl.Segment{{ Name: "dotenv", - Content: "\u2235", + Content: p.symbols.DotEnvIndicator, Foreground: p.theme.DotEnvFg, Background: p.theme.DotEnvBg, }} diff --git a/themes.go b/themes.go index e8101d67..c417931e 100644 --- a/themes.go +++ b/themes.go @@ -20,6 +20,7 @@ type SymbolTemplate struct { RepoConflicted string RepoStashed string + DotEnvIndicator string KubeIndicator string NixShellIndicator string NodeIndicator string