Skip to content

Commit

Permalink
feat(os): allow overriding distro name
Browse files Browse the repository at this point in the history
resolves #5011
  • Loading branch information
JanDeDobbeleer committed Jun 6, 2024
1 parent 2b47173 commit 523cd98
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/segments/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (oi *Os) Enabled() bool {
pf := oi.env.Platform()
displayDistroName := oi.props.GetBool(DisplayDistroName, false)
if displayDistroName {
oi.Icon = pf
oi.Icon = oi.props.GetString(properties.Property(pf), pf)
break
}
oi.Icon = oi.getDistroIcon(pf)
Expand Down
8 changes: 8 additions & 0 deletions src/segments/os_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ func TestOSInfo(t *testing.T) {
GOOS: "linux",
Platform: "crazy",
},
{
Case: "show distro name, mapped",
ExpectedString: "<3",
DisplayDistroName: true,
GOOS: "linux",
Icon: "<3",
Platform: "love",
},
}
for _, tc := range cases {
env := new(mock.MockedEnvironment)
Expand Down

0 comments on commit 523cd98

Please sign in to comment.