diff --git a/data/preferences.json b/data/preferences.json index 29c452d..5a3beb0 100644 --- a/data/preferences.json +++ b/data/preferences.json @@ -4,6 +4,8 @@ "data_path": "/usr/share/manjaro-hello/data/", "desktop_path": "/usr/share/applications/manjaro-hello.desktop", "installer_path": "/usr/bin/calamares", + "plasmawelcome_path": "/usr/bin/plasma-welcome", + "gnometour_path": "/usr/bin/gnome-tour", "live_path": "/run/miso/bootmnt/manjaro", "locale_path": "/usr/share/locale/", "logo_path": "/usr/share/icons/hicolor/64x64/apps/manjaro.png", @@ -22,4 +24,4 @@ "twitter": "https://twitter.com/ManjaroLinux", "wiki": "https://wiki.manjaro.org" } -} \ No newline at end of file +} diff --git a/src/manjaro_hello.py b/src/manjaro_hello.py index fb687b6..8451305 100644 --- a/src/manjaro_hello.py +++ b/src/manjaro_hello.py @@ -33,12 +33,6 @@ class EmbedManager: def display(self, window: Gtk.Window): for app in self.apps: app.display(window) - if app.loaded: - btn = window.builder.get_object(app.name) - if self.count < 2: - btn.set_margin_start(200) - btn.set_margin_end(200) - #TODO if self.count>2 !!! ??? class Embed: @@ -214,6 +208,14 @@ class Hello(Gtk.Window): manager = EmbedManager(EmbedBrowser(), EmbedLayouts()) manager.get_modules(self) manager.display(self) + de = os.environ.get("DESKTOP_SESSION", "unknown") + + if de == "plasma" and os.path.isfile(self.preferences["plasmawelcome_path"]): + self.builder.get_object("deWelcome").set_visible(True) + self.builder.get_object("deWelcome").set_label("Plasma Welcome") + elif de == "gnome" and os.path.isfile(self.preferences["gnometour_path"]): + self.builder.get_object("deWelcome").set_visible(True) + self.builder.get_object("deWelcome").set_label("GNOME Tour") self.window.show() @@ -363,6 +365,14 @@ class Hello(Gtk.Window): dialog = self.builder.get_object("aboutdialog") dialog.run() dialog.hide() + elif name == "deWelcome": + de = os.environ.get("DESKTOP_SESSION", "unknown") + + if de == "plasma": + subprocess.Popen(["plasma-welcome"]) + elif de == "gnome": + subprocess.Popen(["gnome-tour"]) + def on_btn_clicked(self, btn): """Event for applications button.""" diff --git a/ui/manjaro-hello.glade b/ui/manjaro-hello.glade index 63b840a..39c6e18 100644 --- a/ui/manjaro-hello.glade +++ b/ui/manjaro-hello.glade @@ -1,5 +1,5 @@ - + @@ -399,6 +399,8 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we boxPlugins True False + center + 20 True @@ -407,8 +409,6 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we False True Common application selection - 15 - 15 @@ -424,8 +424,6 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we False True Manjaro Gnome config tool - 15 - 15 @@ -434,6 +432,21 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we 1 + + + <dewelcome> + deWelcome + True + True + Desktop Environent-specific Welcome + + + + True + True + 2 + + 0