aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/accounts-service-user.vala9
-rw-r--r--src/service.vala6
2 files changed, 13 insertions, 2 deletions
diff --git a/src/accounts-service-user.vala b/src/accounts-service-user.vala
index 56d981d..7639b2e 100644
--- a/src/accounts-service-user.vala
+++ b/src/accounts-service-user.vala
@@ -18,7 +18,14 @@
*/
-public class AccountServiceUser : Object {
+public class AccountsServiceUser : Object {
+ Act.UserManager accounts_manager = Act.UserManager.get_default();
+ Act.User? user = null;
+
+ public AccountsServiceUser () {
+ user = accounts_manager.get_user(GLib.Environment.get_user_name());
+
+ }
diff --git a/src/service.vala b/src/service.vala
index a246758..b6ed0a5 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -42,6 +42,10 @@ public class IndicatorSound.Service {
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();
+ }
+
this.sync_preferred_players ();
this.settings.changed["interested-media-players"].connect ( () => {
this.sync_preferred_players ();
@@ -87,7 +91,7 @@ public class IndicatorSound.Service {
uint player_action_update_id;
Notify.Notification notification;
bool syncing_preferred_players = false;
- Act.UserManager account_manager = Act.UserManager.get_default();
+ AccountsServiceUser? accounts_service = null;
const double volume_step_percentage = 0.06;