aboutsummaryrefslogtreecommitdiff
path: root/src/service.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-05-31 15:16:57 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-05-31 15:23:00 +0200
commite41dcc8d3f5c49e2c1670a2eaf9ca9067df268ac (patch)
treef561c9e48c25aed12bd93023d66d2d27f2eb35f4 /src/service.c
parent3f6306bd8b19c3b0bd2be7652560b13cacb06c04 (diff)
downloadayatana-indicator-power-e41dcc8d3f5c49e2c1670a2eaf9ca9067df268ac.tar.gz
ayatana-indicator-power-e41dcc8d3f5c49e2c1670a2eaf9ca9067df268ac.tar.bz2
ayatana-indicator-power-e41dcc8d3f5c49e2c1670a2eaf9ca9067df268ac.zip
src/service.c: Prefer mate-power-statistics to gnome-power-statistics if in a MATE session.
Diffstat (limited to 'src/service.c')
-rw-r--r--src/service.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/service.c b/src/service.c
index 07db8ab..cd0e152 100644
--- a/src/service.c
+++ b/src/service.c
@@ -849,10 +849,20 @@ on_statistics_activated (GSimpleAction * a G_GNUC_UNUSED,
GVariant * param,
gpointer gself G_GNUC_UNUSED)
{
- char *cmd = g_strconcat ("gnome-power-statistics", " --device ",
- g_variant_get_string (param, NULL), NULL);
- execute_command (cmd);
- g_free (cmd);
+ if (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "mate"))
+ {
+ char *cmd = g_strconcat ("gnome-power-statistics", " --device ",
+ g_variant_get_string (param, NULL), NULL);
+ execute_command (cmd);
+ g_free (cmd);
+ }
+ else
+ {
+ char *cmd = g_strconcat ("gnome-power-statistics", " --device ",
+ g_variant_get_string (param, NULL), NULL);
+ execute_command (cmd);
+ g_free (cmd);
+ }
}
/***