Merge lp:~larsu/indicator-power/xfce-control-center into lp:indicator-power/14.04

Proposed by Lars Karlitski
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 225
Merged at revision: 222
Proposed branch: lp:~larsu/indicator-power/xfce-control-center
Merge into: lp:indicator-power/14.04
Diff against target: 41 lines (+23/-8)
1 file modified
src/service.c (+23/-8)
To merge this branch: bzr merge lp:~larsu/indicator-power/xfce-control-center
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Sebastien Bacher Approve
Review via email: mp+202641@code.launchpad.net

Description of the change

Run xfce-powermanager-settings when in an Xubuntu session

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Looks good to me!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/service.c'
2--- src/service.c 2014-01-10 02:02:31 +0000
3+++ src/service.c 2014-01-22 10:56:02 +0000
4@@ -692,14 +692,29 @@
5 GVariant * param G_GNUC_UNUSED,
6 gpointer gself G_GNUC_UNUSED)
7 {
8- gchar *path;
9-
10- path = g_find_program_in_path ("unity-control-center");
11- if (path != NULL)
12- execute_command ("unity-control-center power");
13- else
14- execute_command ("gnome-control-center power");
15- g_free (path);
16+ static const gchar *control_center_cmd = NULL;
17+
18+ if (control_center_cmd == NULL)
19+ {
20+ if (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "xubuntu"))
21+ {
22+ control_center_cmd = "xfce4-power-manager-settings";
23+ }
24+ else
25+ {
26+ gchar *path;
27+
28+ path = g_find_program_in_path ("unity-control-center");
29+ if (path != NULL)
30+ control_center_cmd = "unity-control-center power";
31+ else
32+ control_center_cmd = "gnome-control-center power";
33+
34+ g_free (path);
35+ }
36+ }
37+
38+ execute_command (control_center_cmd);
39 }
40
41 static void

Subscribers

People subscribed via source and target branches