From 5681e8207b700e65e2677db778801c8c596e020d Mon Sep 17 00:00:00 2001 From: Ward Nakchbandi Date: Sun, 25 Sep 2022 18:15:28 +0300 Subject: [PATCH] commit --- .../scripts/nobara-layouts/nobara-layouts.py | 176 ++++++++++-------- 1 file changed, 97 insertions(+), 79 deletions(-) diff --git a/src/etc/nobara/scripts/nobara-layouts/nobara-layouts.py b/src/etc/nobara/scripts/nobara-layouts/nobara-layouts.py index 322abc1..4f83e21 100644 --- a/src/etc/nobara/scripts/nobara-layouts/nobara-layouts.py +++ b/src/etc/nobara/scripts/nobara-layouts/nobara-layouts.py @@ -31,8 +31,103 @@ class Application: def extension_refresh_func(): while extension_refresh == True: - print("test") - time.sleep(1.0) + desktop_switch = self.builder.get_object("desktop_switch") + desktop_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep ding@rastersoft.com"], shell=True, stdout=subprocess.DEVNULL) + if (desktop_output.returncode) == 0: + desktop_switch.set_active(True) + else: + desktop_switch.set_active(False) + + audio_switch = self.builder.get_object("audio_switch") + audio_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep volume-mixer@evermiss.net"], shell=True, stdout=subprocess.DEVNULL) + if (audio_output.returncode) == 0: + audio_switch.set_active(True) + else: + audio_switch.set_active(False) + + blur_switch = self.builder.get_object("blur_switch") + blur_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep blur-my-shell@aunetx"], shell=True, stdout=subprocess.DEVNULL) + if (blur_output.returncode) == 0: + blur_switch.set_active(True) + else: + blur_switch.set_active(False) + + tray_switch = self.builder.get_object("tray_switch") + tray_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep trayIconsReloaded@selfmade.pl"], shell=True, stdout=subprocess.DEVNULL) + if (tray_output.returncode) == 0: + tray_switch.set_active(True) + else: + tray_switch.set_active(False) + + + workspace_switch = self.builder.get_object("workspace_switch") + workspace_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep auto-move-windows@gnome-shell-extensions.gcampax.github.com"], shell=True, stdout=subprocess.DEVNULL) + if (workspace_output.returncode) == 0: + workspace_switch.set_active(True) + else: + workspace_switch.set_active(False) + + x11_switch = self.builder.get_object("x11_switch") + x11_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep x11gestures@joseexposito.github.io"], shell=True, stdout=subprocess.DEVNULL) + if (x11_output.returncode) == 0: + x11_switch.set_active(True) + else: + x11_switch.set_active(False) + + clipboard_switch = self.builder.get_object("clipboard_switch") + clipboard_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep gnome-clipboard@b00f.github.io"], shell=True, stdout=subprocess.DEVNULL) + if (clipboard_output.returncode) == 0: + clipboard_switch.set_active(True) + else: + clipboard_switch.set_active(False) + + supergfxctl_switch = self.builder.get_object("supergfxctl_switch") + supergfxctl_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep supergfxctl-gex@asus-linux.org"], shell=True, stdout=subprocess.DEVNULL) + if (supergfxctl_output.returncode) == 0: + supergfxctl_switch.set_active(True) + else: + supergfxctl_switch.set_active(False) + + caffeine_switch = self.builder.get_object("caffeine_switch") + caffeine_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep espresso@coadmunkee.github.com"], shell=True, stdout=subprocess.DEVNULL) + if (caffeine_output.returncode) == 0: + caffeine_switch.set_active(True) + else: + caffeine_switch.set_active(False) + + kde_switch = self.builder.get_object("kde_switch") + kde_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep gsconnect@andyholmes.github.io"], shell=True, stdout=subprocess.DEVNULL) + if (kde_output.returncode) == 0: + kde_switch.set_active(True) + else: + kde_switch.set_active(False) + + weather_switch = self.builder.get_object("weather_switch") + weather_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep openweather-extension@jenslody.de"], shell=True, stdout=subprocess.DEVNULL) + if (weather_output.returncode) == 0: + weather_switch.set_active(True) + else: + weather_switch.set_active(False) + + spacebar_switch = self.builder.get_object("spacebar_switch") + spacebar_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep space-bar@luchrioh"], shell=True, stdout=subprocess.DEVNULL) + if (spacebar_output.returncode) == 0: + spacebar_switch.set_active(True) + else: + spacebar_switch.set_active(False) + stats_switch = self.builder.get_object("stats_switch") + stats_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep Vitals@CoreCoding.com"], shell=True, stdout=subprocess.DEVNULL) + if (stats_output.returncode) == 0: + stats_switch.set_active(True) + else: + stats_switch.set_active(False) + hid_switch = self.builder.get_object("hid_switch") + hid_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep wireless-hid@chlumskyvaclav.gmail.com"], shell=True, stdout=subprocess.DEVNULL) + if (hid_output.returncode) == 0: + hid_switch.set_active(True) + else: + hid_switch.set_active(False) + time.sleep(15.0) t1 = threading.Thread(target=extension_refresh_func) t1.start() @@ -68,83 +163,6 @@ class Application: macostoggle = self.builder.get_object("macos_button") macostoggle.set_active(True) - - desktop_switch = self.builder.get_object("desktop_switch") - desktop_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep ding@rastersoft.com"], shell=True) - if (desktop_output.returncode) == 0: - desktop_switch.set_active(True) - - audio_switch = self.builder.get_object("audio_switch") - audio_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep volume-mixer@evermiss.net"], shell=True) - if (audio_output.returncode) == 0: - audio_switch.set_active(True) - - blur_switch = self.builder.get_object("blur_switch") - blur_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep blur-my-shell@aunetx"], shell=True) - if (blur_output.returncode) == 0: - blur_switch.set_active(True) - - tray_switch = self.builder.get_object("tray_switch") - tray_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep trayIconsReloaded@selfmade.pl"], shell=True) - if (tray_output.returncode) == 0: - tray_switch.set_active(True) - - workspace_switch = self.builder.get_object("workspace_switch") - workspace_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep auto-move-windows@gnome-shell-extensions.gcampax.github.com"], shell=True) - if (workspace_output.returncode) == 0: - workspace_switch.set_active(True) - - - x11_switch = self.builder.get_object("x11_switch") - x11_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep x11gestures@joseexposito.github.io"], shell=True) - if (x11_output.returncode) == 0: - x11_switch.set_active(True) - - - clipboard_switch = self.builder.get_object("clipboard_switch") - clipboard_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep gnome-clipboard@b00f.github.io"], shell=True) - if (clipboard_output.returncode) == 0: - clipboard_switch.set_active(True) - - supergfxctl_switch = self.builder.get_object("supergfxctl_switch") - supergfxctl_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep supergfxctl-gex@asus-linux.org"], shell=True) - if (supergfxctl_output.returncode) == 0: - supergfxctl_switch.set_active(True) - - caffeine_switch = self.builder.get_object("caffeine_switch") - caffeine_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep espresso@coadmunkee.github.com"], shell=True) - if (caffeine_output.returncode) == 0: - caffeine_switch.set_active(True) - - - kde_switch = self.builder.get_object("kde_switch") - kde_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep gsconnect@andyholmes.github.io"], shell=True) - if (kde_output.returncode) == 0: - kde_switch.set_active(True) - - - weather_switch = self.builder.get_object("weather_switch") - weather_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep openweather-extension@jenslody.de"], shell=True) - if (weather_output.returncode) == 0: - weather_switch.set_active(True) - - - spacebar_switch = self.builder.get_object("spacebar_switch") - spacebar_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep space-bar@luchrioh"], shell=True) - if (spacebar_output.returncode) == 0: - spacebar_switch.set_active(True) - - - stats_switch = self.builder.get_object("stats_switch") - stats_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep Vitals@CoreCoding.com"], shell=True) - if (stats_output.returncode) == 0: - stats_switch.set_active(True) - - - hid_switch = self.builder.get_object("hid_switch") - hid_output = subprocess.run(["gsettings get org.gnome.shell enabled-extensions | grep wireless-hid@chlumskyvaclav.gmail.com"], shell=True) - if (hid_output.returncode) == 0: - hid_switch.set_active(True) ### Layouts ###