aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2014-01-22 11:30:25 +0000
committerTarmac <Unknown>2014-01-22 11:30:25 +0000
commiteab48350d56666d8120e0ddbedc772b40520490b (patch)
treeb5a1078525d723e07296168f7670b06748aedc64
parent10c22e36e37f07ae412438459638304e41a1f0fc (diff)
parente10669ba0b1e976a760cb34342da577e3db6c4f8 (diff)
downloadayatana-indicator-power-eab48350d56666d8120e0ddbedc772b40520490b.tar.gz
ayatana-indicator-power-eab48350d56666d8120e0ddbedc772b40520490b.tar.bz2
ayatana-indicator-power-eab48350d56666d8120e0ddbedc772b40520490b.zip
Run xfce-powermanager-settings when in an Xubuntu session.
Approved by PS Jenkins bot, Sebastien Bacher.
-rw-r--r--src/service.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/service.c b/src/service.c
index fe69c6d..982a24e 100644
--- a/src/service.c
+++ b/src/service.c
@@ -692,14 +692,29 @@ on_settings_activated (GSimpleAction * a G_GNUC_UNUSED,
GVariant * param G_GNUC_UNUSED,
gpointer gself G_GNUC_UNUSED)
{
- gchar *path;
+ static const gchar *control_center_cmd = NULL;
- path = g_find_program_in_path ("unity-control-center");
- if (path != NULL)
- execute_command ("unity-control-center power");
- else
- execute_command ("gnome-control-center power");
- g_free (path);
+ if (control_center_cmd == NULL)
+ {
+ if (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "xubuntu"))
+ {
+ control_center_cmd = "xfce4-power-manager-settings";
+ }
+ else
+ {
+ gchar *path;
+
+ path = g_find_program_in_path ("unity-control-center");
+ if (path != NULL)
+ control_center_cmd = "unity-control-center power";
+ else
+ control_center_cmd = "gnome-control-center power";
+
+ g_free (path);
+ }
+ }
+
+ execute_command (control_center_cmd);
}
static void