mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-07 08:44:07 +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.
|
// isLinuxRunningDesktop checks if a Linux OS is running desktop environment.
|
||||||
func isLinuxRunningDesktop() bool {
|
func isLinuxRunningDesktop() bool {
|
||||||
for _, env := range os.Environ() {
|
return os.Getenv("DESKTOP_SESSION") != "" || os.Getenv("XDG_CURRENT_DESKTOP") != ""
|
||||||
values := strings.Split(env, "=")
|
|
||||||
if len(values) == 2 {
|
|
||||||
key, value := values[0], values[1]
|
|
||||||
if key == "XDG_CURRENT_DESKTOP" && value != "" {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// isPKCEFlow determines if the PKCE flow is active or not,
|
// isPKCEFlow determines if the PKCE flow is active or not,
|
||||||
|
Loading…
Reference in New Issue
Block a user