aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/service.vala22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/service.vala b/src/service.vala
index 6835896..7f4982f 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -46,9 +46,9 @@ public class IndicatorSound.Service: Object {
this.volume_control.bind_property ("active-mic", menu, "show-mic-volume", BindingFlags.SYNC_CREATE);
});
- if (GLib.Environment.get_user_name() != "lightdm") {
- accounts_service = new AccountsServiceUser();
- }
+ /* Setup handling for the greeter-export setting */
+ this.settings.changed["greeter-export"].connect( () => this.build_accountsservice() );
+ build_accountsservice();
this.sync_preferred_players ();
this.settings.changed["interested-media-players"].connect ( () => {
@@ -66,6 +66,22 @@ public class IndicatorSound.Service: Object {
sharedsettings.bind ("allow-amplified-volume", this, "allow-amplified-volume", SettingsBindFlags.GET);
}
+ void build_accountsservice () {
+ this.accounts_service = null;
+
+ /* If we're not exporting, don't build anything */
+ if (!this.settings.get_boolean("greeter-export")) {
+ return;
+ }
+
+ /* If we're on the greeter, don't export */
+ if (GLib.Environment.get_user_name() == "lightdm") {
+ return;
+ }
+
+ this.accounts_service = new AccountsServiceUser();
+ }
+
public int run () {
if (this.loop != null) {
warning ("service is already running");