mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-16 07:16:38 +00:00
update check for linux running desktop (#1137)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user