From 0c1c387c9867f93c0af353e70ef795ef4b35b8d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 6 Nov 2025 13:51:07 -0800 Subject: [PATCH 1/3] Only run in Pantheon --- data/settings.desktop.in | 3 ++- src/Application.vala | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/data/settings.desktop.in b/data/settings.desktop.in index 21ac4aaa..827fbfce 100644 --- a/data/settings.desktop.in +++ b/data/settings.desktop.in @@ -3,12 +3,13 @@ Type=Application Name=System Settings Comment=Change system and user settings -Categories=GNOME;GTK;System; +Categories=GTK;System; Keywords=Center;Control;Panel;Preferences;System; Icon=io.elementary.settings Exec=io.elementary.settings %u DBusActivatable=true +OnlyShowIn=Pantheon; SingleMainWindow=true StartupNotify=true Terminal=false diff --git a/src/Application.vala b/src/Application.vala index 5e4d97f5..26500ff4 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -71,6 +71,10 @@ namespace Switchboard { public override void startup () { base.startup (); + if (GLib.Environment.get_variable ("XDG_CURRENT_DESKTOP") != "Pantheon") { + quit (); + } + Granite.init (); var granite_settings = Granite.Settings.get_default (); From deaad6aff5132100cfb1667b0cde63377abafb13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 6 Nov 2025 13:52:53 -0800 Subject: [PATCH 2/3] Add an error message --- src/Application.vala | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Application.vala b/src/Application.vala index 26500ff4..54237acc 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -72,6 +72,7 @@ namespace Switchboard { base.startup (); if (GLib.Environment.get_variable ("XDG_CURRENT_DESKTOP") != "Pantheon") { + critical (_("System Settings can only be run in a Pantheon desktop session")); quit (); } From fee770ec4b4dfbc4e109d4af75c233b2dd2959d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 7 Nov 2025 14:17:22 -0800 Subject: [PATCH 3/3] Return in mainloop, don't localize --- src/Application.vala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Application.vala b/src/Application.vala index 54237acc..f6111c3a 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -71,11 +71,6 @@ namespace Switchboard { public override void startup () { base.startup (); - if (GLib.Environment.get_variable ("XDG_CURRENT_DESKTOP") != "Pantheon") { - critical (_("System Settings can only be run in a Pantheon desktop session")); - quit (); - } - Granite.init (); var granite_settings = Granite.Settings.get_default (); @@ -266,6 +261,11 @@ namespace Switchboard { } public static int main (string[] args) { + if (GLib.Environment.get_variable ("XDG_CURRENT_DESKTOP") != "Pantheon") { + critical ("System Settings can only be run in a Pantheon desktop session"); + return 1; + } + var app = new SwitchboardApp (); return app.run (args); }