aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-02-12 17:07:33 -0600
committerTed Gould <ted@gould.cx>2014-02-12 17:07:33 -0600
commit0b76536b27f57db75a101e8ce7e3f75b7cddf57c (patch)
treec70a1c8391570c442c36071b3e6cb41f645f7716 /src/main.c
parent11105537ec91c601fdf0012ed69dc2d64aeea3d4 (diff)
downloadayatana-indicator-sound-0b76536b27f57db75a101e8ce7e3f75b7cddf57c.tar.gz
ayatana-indicator-sound-0b76536b27f57db75a101e8ce7e3f75b7cddf57c.tar.bz2
ayatana-indicator-sound-0b76536b27f57db75a101e8ce7e3f75b7cddf57c.zip
Detect which player list we need at startup
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 0a893b3..a14bdea 100644
--- a/src/main.c
+++ b/src/main.c
@@ -21,7 +21,13 @@ main (int argc, char ** argv) {
/* Initialize libnotify */
notify_init ("indicator-sound");
- MediaPlayerList * playerlist = MEDIA_PLAYER_LIST(media_player_list_mpris_new());
+ MediaPlayerList * playerlist = NULL;
+
+ if (g_strcmp0("lightdm", g_get_user_name())) {
+ playerlist = MEDIA_PLAYER_LIST(media_player_list_greeter_new());
+ } else {
+ playerlist = MEDIA_PLAYER_LIST(media_player_list_mpris_new());
+ }
service = indicator_sound_service_new (playerlist);
result = indicator_sound_service_run (service);