From 403d30ddf2d8a9b95bde5cbc12ab88c429656463 Mon Sep 17 00:00:00 2001 From: axtloss Date: Tue, 6 Sep 2022 18:48:46 +0200 Subject: [PATCH] Fix jade config failing to get saved --- src/classes/install_prefs.py | 70 ++++++++++++++++----------------- src/functions/summary_screen.py | 2 +- src/scripts/install.sh | 2 +- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/classes/install_prefs.py b/src/classes/install_prefs.py index 43269d0..aaed9ed 100644 --- a/src/classes/install_prefs.py +++ b/src/classes/install_prefs.py @@ -58,50 +58,50 @@ def __init__( def generate_json(self): prefs = { - 'partition': { - 'device': self.disk, - 'mode': self.partition_mode, - 'efi': self.is_efi, - 'partitions': self.partitions, + '"partition"': { + '"device"': '"'+self.disk+'"', + '"mode"': '"Auto"', + '"efi"': self.is_efi, + '"partitions"': [], }, - 'bootloader': { - 'type': self.bootloader_type, - 'location': self.bootloader_location + '"bootloader"': { + '"type"': '"'+self.bootloader_type+'"', + '"location"': '"'+self.bootloader_location+'"' }, - 'locale': { - 'locale': [ - self.timezone.locale + '"locale"': { + '"locale"': [ + '"'+ self.timezone.locale+'"' ], - 'keymap': self.layout.country_shorthand, - 'timezone': self.timezone.region+"/"+self.timezone.location + '"keymap"': '"'+self.layout.country_shorthand+'"', + '"timezone"': '"'+self.timezone.region+"/"+self.timezone.location+'"' }, - 'networking': { - 'hostname': self.hostname, - 'ipv6': self.ipv_enabled + '"networking"': { + '"hostname"': '"'+self.hostname+'"', + '"ipv6"': self.ipv_enabled }, - 'users': [ + '"users"': [ { - 'name': self.username, - 'password': self.password, - 'hasroot': self.enable_sudo, - 'shell': 'zsh' + '"name"': '"'+self.username+'"', + '"password"': '"'+self.password+'"', + '"hasroot"': self.enable_sudo, + '"shell"': '"zsh"' } ], - 'rootpass': self.password, - 'desktop': self.desktop.lower(), - 'timeshift': self.timeshift_enabled, - 'extra_packages': [ - 'ttf-nerd-fonts-symbols-1000-em-mono' + '"rootpass"': '"'+self.password+'"', + '"desktop"': '"'+self.desktop.lower()+'"', + '"timeshift"': self.timeshift_enabled, + '"extra_packages"': [ + '"ttf-nerd-fonts-symbols-1000-em-mono"' ], - 'flatpak': True, - 'zramd': self.zramd_enabled, - 'unakite': { - 'enable': False, - 'root': '/dev/null', - 'oldroot': self.disk, - 'efidir': '/dev/null', - 'bootdev': '/dev/null' + '"flatpak"': True, + '"zramd"': self.zramd_enabled, + '"unakite"': { + '"enable"': False, + '"root"': '"/dev/null"', + '"oldroot"': '"'+self.disk+'"', + '"efidir"': '"/dev/null"', + '"bootdev"': '"/dev/null"' }, - 'kernel': 'linux' + '"kernel"': '"linux"' } return json.dumps(prefs) diff --git a/src/functions/summary_screen.py b/src/functions/summary_screen.py index d1a7a49..bddcf20 100644 --- a/src/functions/summary_screen.py +++ b/src/functions/summary_screen.py @@ -64,7 +64,7 @@ def carousel_next(self, widget): self.window.set_previous_page(None) self.main_carousel.scroll_to(self.next_page, True) #(self.window.installer_screen.install()) - subprocess.run([shutil.which("bash"), "-c", "bash -- /app/share/jade-gui/jade_gui/scripts/savePrefs.sh '"+self.installprefs.generate_json()+"'"], capture_output=False) + subprocess.run(["bash", "-c", "bash -- /app/share/jade-gui/jade_gui/scripts/savePrefs.sh '"+self.installprefs.generate_json()+"'"], capture_output=False) RunAsync(self.window.installer_screen.install, callback=self.window.installer_screen.carousel_next) def initialize(self): diff --git a/src/scripts/install.sh b/src/scripts/install.sh index 35bb15a..a8e656c 100644 --- a/src/scripts/install.sh +++ b/src/scripts/install.sh @@ -1,2 +1,2 @@ #!/usr/bin/bash -flatpak-spawn --host pkexec jade config /tmp/jade.json +flatpak-spawn --host bash -c "echo $1 > /tmp/jade.json" \ No newline at end of file