Skip to content

Commit 82f3475

Browse files
committed
add support for custom emoji
1 parent 1e9f85d commit 82f3475

File tree

13 files changed

+736
-87
lines changed

13 files changed

+736
-87
lines changed

README.md

+55
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,20 @@ You can now override the context portForward default address configuration by se
419419
skin: dracula # => assumes the file skins/dracula.yaml is present in the $XDG_DATA_HOME/k9s/skins directory
420420
# Allows to set certain views default fullscreen mode. (yaml, helm history, describe, value_extender, details, logs) Default false
421421
defaultsToFullScreen: false
422+
# Customize emojis used in the UI
423+
emoji:
424+
# General UI emojis
425+
startUp: "🐶"
426+
commandLine: "🐶"
427+
filterLine: "🐩"
428+
happy: "😎"
429+
warn: "😗"
430+
angry: "😡"
431+
# XRay view emojis
432+
xray:
433+
pods: "🚛"
434+
deployments: "🪂"
435+
# ... more resource emoji can be customized (see internal/config/json/schemas/k9s.json)
422436
# Toggles icons display as not all terminal support these chars.
423437
noIcons: false
424438
# Toggles whether k9s should check for the latest revision from the GitHub repository releases. Default is false.
@@ -918,6 +932,47 @@ roleRef:
918932
919933
---
920934
935+
## Custom Emoji
936+
937+
You can customize emoji displayed in K9s by configuring the `emoji` section in your K9s configuration. This allows you to personalize various icons used throughout the application.
938+
939+
```yaml
940+
# $XDG_CONFIG_HOME/k9s/config.yaml
941+
k9s:
942+
ui:
943+
emoji:
944+
# Main UI emoji
945+
startUp: "🐶"
946+
commandLine: "🐶"
947+
filterLine: "🐩"
948+
happy: "😎"
949+
warn: "😗"
950+
angry: "😡"
951+
file: "🦄"
952+
folder: "📁"
953+
checkMark: ""
954+
logStreamCancelled: "🏁"
955+
newVersion: "⚡️"
956+
# XRay view emojis
957+
xray:
958+
namespaces: "🗂"
959+
defaultGvr: "📎"
960+
nodes: "🖥"
961+
pods: "🚛"
962+
services: "💁‍♀️"
963+
# Many more XRay icons available... (see internal/config/json/schemas/k9s.json)
964+
```
965+
966+
To disable all emojis, you can use the `noIcons` option instead:
967+
968+
```yaml
969+
k9s:
970+
ui:
971+
noIcons: true
972+
```
973+
974+
---
975+
921976
## Skins
922977
923978
Example: Dracula Skin ;)

cmd/root.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ func run(cmd *cobra.Command, args []string) error {
123123
}
124124

125125
func loadConfiguration() (*config.Config, error) {
126-
log.Info().Msg("🐶 K9s starting up...")
127-
128126
k8sCfg := client.NewConfig(k8sFlags)
129127
k9sCfg := config.NewConfig(k8sCfg)
130128
var errs error
@@ -138,6 +136,8 @@ func loadConfiguration() (*config.Config, error) {
138136
errs = errors.Join(errs, err)
139137
}
140138

139+
log.Info().Msg(k9sCfg.K9s.UI.Emoji.StartUpEmoji() + " K9s starting up...")
140+
141141
conn, err := client.InitConnection(k8sCfg)
142142

143143
if err != nil {
@@ -155,7 +155,7 @@ func loadConfiguration() (*config.Config, error) {
155155

156156
k9sCfg.SetConnection(conn)
157157

158-
log.Info().Msg("✅ Kubernetes connectivity")
158+
log.Info().Msg(k9sCfg.K9s.UI.Emoji.CheckMarkEmoji() + " Kubernetes connectivity")
159159
if err := k9sCfg.Save(false); err != nil {
160160
log.Error().Err(err).Msg("Config save")
161161
errs = errors.Join(errs, err)

0 commit comments

Comments
 (0)