mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 15:46:44 +00:00
Don't shell out to obtain process and system stats
This commit is contained in:
@ -21,12 +21,13 @@
|
||||
package theme
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/sys/execabs"
|
||||
)
|
||||
|
||||
func detectSystemTheme() Theme {
|
||||
out, err := exec.Command("defaults", "read", "-g", "AppleInterfaceStyle").Output() //nolint:gosec
|
||||
out, err := execabs.Command("defaults", "read", "-g", "AppleInterfaceStyle").Output() //nolint:gosec
|
||||
if err == nil && strings.TrimSpace(string(out)) == "Dark" {
|
||||
return Dark
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user