Revert "Accept any XDG_ environment variable to determine desktop (#2037)" (#2042)

This reverts commit 67e2185964.
This commit is contained in:
Maycon Santos
2024-05-23 23:15:02 +02:00
committed by GitHub
parent 29a2d93873
commit 69048bfd34
2 changed files with 1 additions and 25 deletions

View File

@@ -219,15 +219,5 @@ func openURL(cmd *cobra.Command, verificationURIComplete, userCode string) {
// isLinuxRunningDesktop checks if a Linux OS is running desktop environment
func isLinuxRunningDesktop() bool {
if os.Getenv("DESKTOP_SESSION") != "" {
return true
}
for _, env := range os.Environ() {
if strings.HasPrefix(env, "XDG_") {
return true
}
}
return false
return os.Getenv("DESKTOP_SESSION") != "" || os.Getenv("XDG_CURRENT_DESKTOP") != ""
}