aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-03-15 22:33:44 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-03-15 22:33:44 +0100
commit2026ee0ea8ea662c7fa9cef0d3a1bc043212f542 (patch)
tree9eb779f7ea07ba2b14056304eca20ec049e8769b /src/utils.c
parent60363ad00518bf0d4b85ddc74e407a8ed0cbcb83 (diff)
downloadayatana-indicator-power-2026ee0ea8ea662c7fa9cef0d3a1bc043212f542.tar.gz
ayatana-indicator-power-2026ee0ea8ea662c7fa9cef0d3a1bc043212f542.tar.bz2
ayatana-indicator-power-2026ee0ea8ea662c7fa9cef0d3a1bc043212f542.zip
src/utils.c: Add is_pantheon() function.
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index ad6d510..f41b275 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -146,3 +146,24 @@ is_mate ()
}
return FALSE;
}
+
+gboolean
+is_pantheon ()
+{
+ const gchar *xdg_current_desktop;
+ gchar **desktop_names;
+ int i;
+
+ xdg_current_desktop = g_getenv ("XDG_CURRENT_DESKTOP");
+ if (xdg_current_desktop != NULL) {
+ desktop_names = g_strsplit (xdg_current_desktop, ":", 0);
+ for (i = 0; desktop_names[i]; ++i) {
+ if (!g_strcmp0 (desktop_names[i], "Pantheon")) {
+ g_strfreev (desktop_names);
+ return TRUE;
+ }
+ }
+ g_strfreev (desktop_names);
+ }
+ return FALSE;
+}