use apx for subsystem

main
mirkobrombin 2 years ago
parent 02670fca54
commit 046c318259

2
debian/changelog vendored

@ -1,4 +1,4 @@
vanilla-first-setup (0.1.3) jammy; urgency=low vanilla-first-setup (0.1.4) jammy; urgency=low
* First release * First release

@ -1,5 +1,5 @@
project('io.github.vanilla-os.FirstSetup', project('io.github.vanilla-os.FirstSetup',
version: '0.1.3', version: '0.1.4',
meson_version: '>= 0.59.0', meson_version: '>= 0.59.0',
default_options: [ 'warning_level=2', default_options: [ 'warning_level=2',
'werror=false', 'werror=false',

@ -12,22 +12,22 @@ class Config:
flatpak: bool, flatpak: bool,
appimage: bool, appimage: bool,
apport: bool, apport: bool,
distrobox: bool, apx: bool,
nvidia: bool, nvidia: bool,
): ):
self.snap = snap self.snap = snap
self.flatpak = flatpak self.flatpak = flatpak
self.appimage = appimage self.appimage = appimage
self.apport = apport self.apport = apport
self.distrobox = distrobox self.apx = apx
self.nvidia = nvidia self.nvidia = nvidia
def get_str(self) -> str: def get_str(self) -> str:
keys = [ keys = [
"snap", "flatpak", "appimage", "apport", "distrobox", "nvidia" "snap", "flatpak", "appimage", "apport", "apx", "nvidia"
] ]
vals = [ vals = [
self.snap, self.flatpak, self.appimage, self.apport, self.distrobox, self.nvidia self.snap, self.flatpak, self.appimage, self.apport, self.apx, self.nvidia
] ]
return "|".join([f"{key}::{val}" for key, val in zip(keys, vals)]) return "|".join([f"{key}::{val}" for key, val in zip(keys, vals)])
@ -40,8 +40,8 @@ class Config:
self.appimage = val self.appimage = val
elif key == "apport": elif key == "apport":
self.apport = val self.apport = val
elif key == "distrobox": elif key == "apx":
self.distrobox = val self.apx = val
elif key == "nvidia": elif key == "nvidia":
self.nvidia = val self.nvidia = val
else: else:
@ -60,7 +60,7 @@ class Config:
flatpak = items[1].split('::')[1] flatpak = items[1].split('::')[1]
appimage = items[2].split('::')[1] appimage = items[2].split('::')[1]
apport = items[3].split('::')[1] apport = items[3].split('::')[1]
distrobox = items[4].split('::')[1] apx = items[4].split('::')[1]
nvidia = items[5].split('::')[1] nvidia = items[5].split('::')[1]
return cls( return cls(
@ -68,6 +68,6 @@ class Config:
flatpak=get_bool(flatpak), flatpak=get_bool(flatpak),
appimage=get_bool(appimage), appimage=get_bool(appimage),
apport=get_bool(apport), apport=get_bool(apport),
distrobox=get_bool(distrobox), apx=get_bool(apx),
nvidia=get_bool(nvidia), nvidia=get_bool(nvidia),
) )

@ -4,5 +4,5 @@ class Preset:
flatpak: bool = True flatpak: bool = True
appimage: bool = False appimage: bool = False
apport: bool = False apport: bool = False
distrobox: bool = True apx: bool = True
nvidia: bool = False nvidia: bool = False

@ -26,8 +26,8 @@ class Configurator:
self.__enable_flatpak() if self.config.flatpak else self.__disable_flatpak() self.__enable_flatpak() if self.config.flatpak else self.__disable_flatpak()
self.__enable_appimage() if self.config.appimage else self.__disable_appimage() self.__enable_appimage() if self.config.appimage else self.__disable_appimage()
self.__enable_apport() if self.config.apport else self.__disable_apport() self.__enable_apport() if self.config.apport else self.__disable_apport()
if self.config.distrobox: if self.config.apx:
self.__enable_distrobox() self.__enable_apx()
if self.config.nvidia: if self.config.nvidia:
self.__enable_nvidia() self.__enable_nvidia()
@ -99,11 +99,11 @@ class Configurator:
subprocess.run(['sudo', 'systemctl', 'stop', 'apport.service']) subprocess.run(['sudo', 'systemctl', 'stop', 'apport.service'])
Apt.purge(['apport']) Apt.purge(['apport'])
def __enable_distrobox(self): def __enable_apx(self):
if self.fake: if self.fake:
return self.__fake("Fake: Distrobox enabled") return self.__fake("Fake: apx enabled")
Apt.install(['curl', 'podman']) Apt.install(['curl', 'podman', 'apx'])
Apt.update() Apt.update()
proc = subprocess.run(['curl', '-s', 'https://raw.githubusercontent.com/89luca89/distrobox/main/install'], stdout=subprocess.PIPE) proc = subprocess.run(['curl', '-s', 'https://raw.githubusercontent.com/89luca89/distrobox/main/install'], stdout=subprocess.PIPE)

@ -70,7 +70,7 @@ class FirstSetupWindow(Adw.ApplicationWindow):
flatpak=Preset.flatpak, flatpak=Preset.flatpak,
appimage=Preset.appimage, appimage=Preset.appimage,
apport=Preset.apport, apport=Preset.apport,
distrobox=Preset.distrobox, apx=Preset.apx,
nvidia=Preset.nvidia, nvidia=Preset.nvidia,
) )
self.__has_nvidia = has_nvidia_gpu() self.__has_nvidia = has_nvidia_gpu()
@ -144,14 +144,14 @@ class FirstSetupWindow(Adw.ApplicationWindow):
def __on_switch_apport_state_set(self, widget, state): def __on_switch_apport_state_set(self, widget, state):
self.__config.set_val('apport', state) self.__config.set_val('apport', state)
def __on_switch_distrobox_state_set(self, widget, state): def __on_switch_apx_state_set(self, widget, state):
self.__config.set_val('distrobox', state) self.__config.set_val('apx', state)
def on_btn_reboot_clicked(self, widget): def on_btn_reboot_clicked(self, widget):
Configurator.reboot() Configurator.reboot()
def on_btn_subsystem_clicked(self, widget, state): def on_btn_subsystem_clicked(self, widget, state):
self.__config.set_val('distrobox', state) self.__config.set_val('apx', state)
self.__show_page(page=self.page_nvidia_drivers if self.__has_nvidia else self.page_extras) self.__show_page(page=self.page_nvidia_drivers if self.__has_nvidia else self.page_extras)
def __on_btn_info_subsystem_clicked(self, widget): def __on_btn_info_subsystem_clicked(self, widget):

Loading…
Cancel
Save