From 738d23cf5171e79058be1870da023bf00c48e7dd Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Thu, 4 Jan 2018 00:55:32 +0900 Subject: [PATCH] devicescale: Bug fix: need to parse XDG_CURRENT_DESKTOP for GNOME classic --- internal/devicescale/devicescale_unix.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/devicescale/devicescale_unix.go b/internal/devicescale/devicescale_unix.go index 32441f8af..15e702d77 100644 --- a/internal/devicescale/devicescale_unix.go +++ b/internal/devicescale/devicescale_unix.go @@ -23,6 +23,7 @@ import ( "os/exec" "regexp" "strconv" + "strings" ) type windowManager int @@ -34,7 +35,8 @@ const ( ) func currentWindowManager() windowManager { - switch os.Getenv("XDG_CURRENT_DESKTOP") { + tokens := strings.Split(os.Getenv("XDG_CURRENT_DESKTOP"), ":") + switch tokens[len(tokens)-1] { case "GNOME": return windowManagerGnome case "X-Cinnamon":