aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-09-15 11:43:03 +0200
committerMihai Moldovan <ionic@ionic.de>2023-09-15 15:34:21 +0200
commit2c4ff94ef0d664fa8355db2f7035d5bf0c102690 (patch)
tree9d83c2a3a131b02ec9b30412543425cf9d0a413a
parentb542dbe65eec71a156c828dc998f59d77b516cb2 (diff)
downloadarctica-greeter-2c4ff94ef0d664fa8355db2f7035d5bf0c102690.tar.gz
arctica-greeter-2c4ff94ef0d664fa8355db2f7035d5bf0c102690.tar.bz2
arctica-greeter-2c4ff94ef0d664fa8355db2f7035d5bf0c102690.zip
Introduce gsetting (array of strings): preferred-sessions.
The preferred-session gsetting shall provide an ordered list of preferred sessions for detecing the default session type.
-rw-r--r--data/org.ArcticaProject.arctica-greeter.gschema.xml4
-rw-r--r--src/arctica-greeter.vala13
-rw-r--r--src/settings.vala1
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)
{