From 32df70ed9a55a9ec66c1689a007df9714bee16f5 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Thu, 15 Mar 2018 22:34:45 +0100 Subject: src/utils.c: Use our desktop detection functions for find a way to open an appropriate power settings dialog. --- src/utils.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils.c b/src/utils.c index f41b275..2e4c4cb 100644 --- a/src/utils.c +++ b/src/utils.c @@ -55,19 +55,20 @@ utils_handle_settings_request (void) } else #endif + /* XFCE does not set XDG_CURRENT_DESKTOP, it seems... */ if ((!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "xubuntu")) || (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "xfce"))) { control_center_cmd = "xfce4-power-manager-settings"; } - else if (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "mate")) + else if (is_mate()) { control_center_cmd = "mate-power-preferences"; } - else if (!g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Pantheon")) + else if (is_pantheon()) { control_center_cmd = "switchboard --open-plug system-pantheon-power"; } - else + else if (is_unity() || is_gnome()) { gchar *path; -- cgit v1.2.3