diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2014-01-22 11:30:25 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2014-01-22 11:30:25 +0000 |
commit | eab48350d56666d8120e0ddbedc772b40520490b (patch) | |
tree | b5a1078525d723e07296168f7670b06748aedc64 | |
parent | 10c22e36e37f07ae412438459638304e41a1f0fc (diff) | |
parent | e10669ba0b1e976a760cb34342da577e3db6c4f8 (diff) | |
download | ayatana-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.c | 29 |
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 |