mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-23 23:29:15 +01:00
update check for linux running desktop (#1137)
This commit is contained in:
parent
30f1c54ed1
commit
bb791d59f3
@ -232,16 +232,7 @@ func openURL(cmd *cobra.Command, verificationURIComplete, userCode string) {
|
||||
|
||||
// isLinuxRunningDesktop checks if a Linux OS is running desktop environment.
|
||||
func isLinuxRunningDesktop() bool {
|
||||
for _, env := range os.Environ() {
|
||||
values := strings.Split(env, "=")
|
||||
if len(values) == 2 {
|
||||
key, value := values[0], values[1]
|
||||
if key == "XDG_CURRENT_DESKTOP" && value != "" {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
return os.Getenv("DESKTOP_SESSION") != "" || os.Getenv("XDG_CURRENT_DESKTOP") != ""
|
||||
}
|
||||
|
||||
// isPKCEFlow determines if the PKCE flow is active or not,
|
||||
|
Loading…
Reference in New Issue
Block a user