mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-29 04:49:39 -08:00
25 lines
403 B
Go
25 lines
403 B
Go
|
package main
|
||
|
|
||
|
type root struct {
|
||
|
props *properties
|
||
|
env environmentInfo
|
||
|
}
|
||
|
|
||
|
const (
|
||
|
//RootIcon indicates the root user
|
||
|
RootIcon Property = "root_icon"
|
||
|
)
|
||
|
|
||
|
func (rt *root) enabled() bool {
|
||
|
return rt.env.isRunningAsRoot()
|
||
|
}
|
||
|
|
||
|
func (rt *root) string() string {
|
||
|
return rt.props.getString(RootIcon, "#")
|
||
|
}
|
||
|
|
||
|
func (rt *root) init(props *properties, env environmentInfo) {
|
||
|
rt.props = props
|
||
|
rt.env = env
|
||
|
}
|