* Gets the value of the XDG_CURRENT_DESKTOP environment variable. If ORIGINAL_XDG_CURRENT_DESKTOP is set, it will be returned instead. * This corrects for a strange behavior in Electron, where it sets its own value for XDG_CURRENT_DESKTOP to improve Chromium compatibility. * @see https://www.elect
()
| 213 | * @returns The value of the XDG_CURRENT_DESKTOP environment variable, or ORIGINAL_XDG_CURRENT_DESKTOP if set, or undefined if neither are set. |
| 214 | */ |
| 215 | function getXdgCurrentDesktop(): string { |
| 216 | if (process.env.ORIGINAL_XDG_CURRENT_DESKTOP) { |
| 217 | return process.env.ORIGINAL_XDG_CURRENT_DESKTOP; |
| 218 | } else if (process.env.XDG_CURRENT_DESKTOP) { |
| 219 | return process.env.XDG_CURRENT_DESKTOP; |
| 220 | } else { |
| 221 | return undefined; |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | /** |
| 226 | * Calls the given callback with the value of the XDG_CURRENT_DESKTOP environment variable set to ORIGINAL_XDG_CURRENT_DESKTOP if it is set. |
no outgoing calls
no test coverage detected