diff options
-rw-r--r-- | data/org.ArcticaProject.arctica-greeter.gschema.xml | 4 | ||||
-rw-r--r-- | src/arctica-greeter.vala | 13 | ||||
-rw-r--r-- | src/settings.vala | 1 |
3 files changed, 10 insertions, 8 deletions
diff --git a/data/org.ArcticaProject.arctica-greeter.gschema.xml b/data/org.ArcticaProject.arctica-greeter.gschema.xml index 52633c5..ddef373 100644 --- a/data/org.ArcticaProject.arctica-greeter.gschema.xml +++ b/data/org.ArcticaProject.arctica-greeter.gschema.xml @@ -211,6 +211,10 @@ <default>false</default> <summary>Whether to hide Wayland sessions.</summary> </key> + <key name="preferred-sessions" type="as"> + <default>[]</default> + <summary>Ordered list of preferred desktop sessions (for detecting the default session type).</summary> + </key> <key name="shutdown-dialog-timeout" type="i"> <default>60</default> <summary>Time in seconds until the shutdown dialog forcefully selects the default action. Set to 0 to disable.</summary> diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala index 2ede4c5..cacfdac 100644 --- a/src/arctica-greeter.vala +++ b/src/arctica-greeter.vala @@ -248,14 +248,11 @@ public class ArcticaGreeter : Object var sessions = new List<string> (); sessions.append ("lightdm-xsession"); - // FIXME: this list should be obtained from AGSettings, ideally... - sessions.append ("mate"); - sessions.append ("xfce"); - sessions.append ("kde-plasma"); - sessions.append ("kde"); - sessions.append ("gnome"); - sessions.append ("cinnamon"); - sessions.append ("lomiri"); + var preferred_sessions = AGSettings.get_strv (AGSettings.KEY_PREFERRED_SESSIONS); + + foreach (var preferred_session in preferred_sessions) { + sessions.append (preferred_session); + } if (!AGSettings.get_boolean (AGSettings.KEY_HIDE_WAYLAND_SESSIONS)) { foreach (string session in sessions) { diff --git a/src/settings.vala b/src/settings.vala index 16b5a82..acef828 100644 --- a/src/settings.vala +++ b/src/settings.vala @@ -74,6 +74,7 @@ public class AGSettings : Object public const string KEY_HIDE_X11_SESSIONS = "hide-x11-sessions"; public const string KEY_HIDE_WAYLAND_SESSIONS = "hide-wayland-sessions"; public const string KEY_SHUTDOWN_DIALOG_TIMEOUT = "shutdown-dialog-timeout"; + public const string KEY_PREFERRED_SESSIONS = "preferred-sessions"; public static bool get_boolean (string key) { |