aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@ubuntu.com>2016-03-24 22:12:06 +0100
committerDmitry Shachnev <mitya57@ubuntu.com>2016-03-24 22:12:06 +0100
commitc4039b86ab3829e439e3e44fe6663f6e31b2df69 (patch)
tree94b6f8feb9420d71dc0b50bfe502a66fedf645e1
parentd030b55288d8d31c0d8a788422588c93157fdc55 (diff)
downloadayatana-indicator-sound-c4039b86ab3829e439e3e44fe6663f6e31b2df69.tar.gz
ayatana-indicator-sound-c4039b86ab3829e439e3e44fe6663f6e31b2df69.tar.bz2
ayatana-indicator-sound-c4039b86ab3829e439e3e44fe6663f6e31b2df69.zip
Support multiple desktop names in XDG_CURRENT_DESKTOP
-rw-r--r--src/service.vala12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/service.vala b/src/service.vala
index 651ec73..e07e9fd 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -226,6 +226,7 @@ public class IndicatorSound.Service: Object {
void activate_desktop_settings (SimpleAction action, Variant? param) {
unowned string env = Environment.get_variable ("DESKTOP_SESSION");
+ unowned string desktop = Environment.get_variable ("XDG_CURRENT_DESKTOP");
string cmd;
if (Environment.get_variable ("MIR_SOCKET") != null)
@@ -240,10 +241,13 @@ public class IndicatorSound.Service: Object {
cmd = "mate-volume-control";
else
{
- if (Environment.get_variable ("XDG_CURRENT_DESKTOP") == "Unity" && Environment.find_program_in_path ("unity-control-center") != null)
- cmd = "unity-control-center sound";
- else
- cmd = "gnome-control-center sound";
+ cmd = "gnome-control-center sound";
+ foreach (var name in desktop.split(":")) {
+ if (name == "Unity" && Environment.find_program_in_path ("unity-control-center") != null) {
+ cmd = "unity-control-center sound";
+ break;
+ }
+ }
}
try {