Skip to content

Commit

Permalink
fix hostname display with custom colors
Browse files Browse the repository at this point in the history
  • Loading branch information
buckley310 committed Jun 22, 2020
1 parent acd9378 commit d520fde
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions segment-hostname.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ func segmentHost(p *powerline) []pwl.Segment {
}

if *p.args.ColorizeHostname {
hostName := getHostName(p.hostname)
hostPrompt = hostName

foregroundEnv, foregroundEnvErr := strconv.ParseInt(os.Getenv("PLGO_HOSTNAMEFG"), 0, 8)
backgroundEnv, backgroundEnvErr := strconv.ParseInt(os.Getenv("PLGO_HOSTNAMEBG"), 0, 8)
if foregroundEnvErr == nil && backgroundEnvErr == nil {
foreground = uint8(foregroundEnv)
background = uint8(backgroundEnv)
} else {
hostName := getHostName(p.hostname)
hostPrompt = hostName

hash := getMd5(hostName)
background = hash[0]
foreground = p.theme.HostnameColorizedFgMap[background]
Expand Down

0 comments on commit d520fde

Please sign in to comment.