It is completed 🎉

Co-authored-by: Mirko Brombin <send@mirko.pm>
pull/6/head
axtloss 2 years ago
parent 74048d616e
commit d18cae4a1e

@ -1,61 +1,276 @@
<svg width="348" height="343" viewBox="0 0 348 343" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M315 5H119C105.745 5 95 15.7452 95 29V272C95 285.255 105.745 296 119 296H315C328.255 296 339 285.255 339 272V29C339 15.7452 328.255 5 315 5Z" fill="#613583"/>
<path d="M315 0H119C105.745 0 95 10.7452 95 24V257C95 270.255 105.745 281 119 281H315C328.255 281 339 270.255 339 257V24C339 10.7452 328.255 0 315 0Z" fill="#813D9C"/>
<g filter="url(#filter0_d_9_3)">
<path d="M308 106C308 56.2944 267.706 16 218 16C168.294 16 128 56.2944 128 106C128 155.706 168.294 196 218 196C267.706 196 308 155.706 308 106Z" fill="#C061CB"/>
</g>
<g filter="url(#filter1_d_9_3)">
<path d="M207.343 269L239.354 237L225.541 223.219L221.125 227.625L230.49 237L198.448 269H207.343Z" fill="#C061CB"/>
<path d="M226.011 205L194 237L207.75 250.719H207.813L212.198 246.344L202.864 237L234.813 205H226.011Z" fill="#C061CB"/>
</g>
<g filter="url(#filter2_d_9_3)">
<path d="M217.035 106.133L318.039 238.49L272.304 263.186L217.035 106.133Z" fill="#DEDDDA"/>
</g>
<g filter="url(#filter3_d_9_3)">
<path d="M114 38H55C52.2386 38 50 40.2386 50 43V215.704C50 217.162 50.6359 218.546 51.7412 219.496L78.9676 242.894C80.7406 244.418 83.3327 244.509 85.209 243.115L116.983 219.499C118.252 218.556 119 217.068 119 215.486V43C119 40.2386 116.761 38 114 38Z" fill="#352B50"/>
<path d="M88.5871 294.136C86.5874 296.814 82.5748 296.814 80.5751 294.136L19.9692 212.992C17.5063 209.695 19.8595 205 23.9751 205H145.187C149.303 205 151.656 209.695 149.193 212.992L88.5871 294.136Z" fill="#352B50"/>
</g>
<defs>
<filter id="filter0_d_9_3" x="124" y="16" width="188" height="188" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="4"/>
<feGaussianBlur stdDeviation="2"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_9_3"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_9_3" result="shape"/>
</filter>
<filter id="filter1_d_9_3" x="187" y="202" width="59.3543" height="78" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="4"/>
<feGaussianBlur stdDeviation="3.5"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_9_3"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_9_3" result="shape"/>
</filter>
<filter id="filter2_d_9_3" x="212.035" y="99.133" width="109.004" height="165.053" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="-1" dy="-3"/>
<feGaussianBlur stdDeviation="2"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_9_3"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_9_3" result="shape"/>
</filter>
<filter id="filter3_d_9_3" x="14.9661" y="34" width="139.23" height="266.144" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset/>
<feGaussianBlur stdDeviation="2"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_9_3"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_9_3" result="shape"/>
</filter>
</defs>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="348"
height="343"
viewBox="0 0 348 343"
fill="none"
version="1.1"
id="svg226"
sodipodi:docname="al.getcryst.jadegui.svg"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview228"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="2.2798834"
inkscape:cx="162.06969"
inkscape:cy="166.67519"
inkscape:window-width="1920"
inkscape:window-height="1011"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg226" />
<path
d="M 282.84032,4.1244755 H 86.840323 c -13.255,0 -24,10.7452005 -24,24.0000005 V 271.12448 c 0,13.255 10.745,24 24,24 H 282.84032 c 13.255,0 24,-10.745 24,-24 V 28.124476 c 0,-13.2548 -10.745,-24.0000005 -24,-24.0000005 z"
fill="#613583"
id="path132" />
<path
d="M 282.84032,-0.8755245 H 86.840323 c -13.255,0 -24,10.7452 -24,24.0000005 V 256.12448 c 0,13.255 10.745,24 24,24 H 282.84032 c 13.255,0 24,-10.745 24,-24 V 23.124476 c 0,-13.2548005 -10.745,-24.0000005 -24,-24.0000005 z"
fill="#813d9c"
id="path134" />
<g
filter="url(#filter0_d_9_3)"
id="g138"
transform="translate(-32.159677,-0.8755245)">
<path
d="m 308,106 c 0,-49.7056 -40.294,-90 -90,-90 -49.706,0 -90,40.2944 -90,90 0,49.706 40.294,90 90,90 49.706,0 90,-40.294 90,-90 z"
fill="#c061cb"
id="path136" />
</g>
<g
filter="url(#filter1_d_9_3)"
id="g144"
transform="translate(-32.159677,-0.8755245)">
<path
d="m 207.343,269 32.011,-32 -13.813,-13.781 -4.416,4.406 9.365,9.375 -32.042,32 z"
fill="#c061cb"
id="path140" />
<path
d="M 226.011,205 194,237 l 13.75,13.719 h 0.063 l 4.385,-4.375 -9.334,-9.344 31.949,-32 z"
fill="#c061cb"
id="path142" />
</g>
<g
filter="url(#filter2_d_9_3)"
id="g148"
transform="matrix(0.75301869,0,0,0.91306217,47.130955,22.092234)">
<path
d="M 217.035,106.133 318.039,238.49 272.304,263.186 Z"
fill="#deddda"
id="path146" />
</g>
<g
filter="url(#filter3_d_9_3)"
id="g154"
style="fill:#4f3f78;fill-opacity:1;stroke:none;stroke-opacity:1"
transform="translate(-16.364256,-0.19360914)">
<path
d="M 114,38 H 55 c -2.7614,0 -5,2.2386 -5,5 v 172.704 c 0,1.458 0.6359,2.842 1.7412,3.792 l 27.2264,23.398 c 1.773,1.524 4.3651,1.615 6.2414,0.221 l 31.774,-23.616 c 1.269,-0.943 2.017,-2.431 2.017,-4.013 V 43 c 0,-2.7614 -2.239,-5 -5,-5 z"
fill="#352B50"
id="path150"
style="fill:#4f3f78;fill-opacity:1;stroke:none;stroke-opacity:1" />
<path
d="m 88.5871,294.136 c -1.9997,2.678 -6.0123,2.678 -8.012,0 L 19.9692,212.992 C 17.5063,209.695 19.8595,205 23.9751,205 H 145.187 c 4.116,0 6.469,4.695 4.006,7.992 z"
fill="#352B50"
id="path152"
style="fill:#4f3f78;fill-opacity:1;stroke:none;stroke-opacity:1" />
</g>
<defs
id="defs224">
<linearGradient
id="linearGradient3107"
inkscape:swatch="solid">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop3105" />
</linearGradient>
<filter
id="filter0_d_9_3"
x="124"
y="16"
width="188"
height="188"
filterUnits="userSpaceOnUse"
color-interpolation-filters="sRGB">
<feFlood
flood-opacity="0"
result="BackgroundImageFix"
id="feFlood156" />
<feColorMatrix
in="SourceAlpha"
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
result="hardAlpha"
id="feColorMatrix158" />
<feOffset
dy="4"
id="feOffset160" />
<feGaussianBlur
stdDeviation="2"
id="feGaussianBlur162" />
<feComposite
in2="hardAlpha"
operator="out"
id="feComposite164" />
<feColorMatrix
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"
id="feColorMatrix166" />
<feBlend
mode="normal"
in2="BackgroundImageFix"
result="effect1_dropShadow_9_3"
id="feBlend168" />
<feBlend
mode="normal"
in="SourceGraphic"
in2="effect1_dropShadow_9_3"
result="shape"
id="feBlend170" />
</filter>
<filter
id="filter1_d_9_3"
x="187"
y="202"
width="59.3543"
height="78"
filterUnits="userSpaceOnUse"
color-interpolation-filters="sRGB">
<feFlood
flood-opacity="0"
result="BackgroundImageFix"
id="feFlood173" />
<feColorMatrix
in="SourceAlpha"
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
result="hardAlpha"
id="feColorMatrix175" />
<feOffset
dy="4"
id="feOffset177" />
<feGaussianBlur
stdDeviation="3.5"
id="feGaussianBlur179" />
<feComposite
in2="hardAlpha"
operator="out"
id="feComposite181" />
<feColorMatrix
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"
id="feColorMatrix183" />
<feBlend
mode="normal"
in2="BackgroundImageFix"
result="effect1_dropShadow_9_3"
id="feBlend185" />
<feBlend
mode="normal"
in="SourceGraphic"
in2="effect1_dropShadow_9_3"
result="shape"
id="feBlend187" />
</filter>
<filter
id="filter2_d_9_3"
x="212.035"
y="99.133"
width="109.004"
height="165.053"
filterUnits="userSpaceOnUse"
color-interpolation-filters="sRGB">
<feFlood
flood-opacity="0"
result="BackgroundImageFix"
id="feFlood190" />
<feColorMatrix
in="SourceAlpha"
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
result="hardAlpha"
id="feColorMatrix192" />
<feOffset
dx="-1"
dy="-3"
id="feOffset194" />
<feGaussianBlur
stdDeviation="2"
id="feGaussianBlur196" />
<feComposite
in2="hardAlpha"
operator="out"
id="feComposite198" />
<feColorMatrix
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"
id="feColorMatrix200" />
<feBlend
mode="normal"
in2="BackgroundImageFix"
result="effect1_dropShadow_9_3"
id="feBlend202" />
<feBlend
mode="normal"
in="SourceGraphic"
in2="effect1_dropShadow_9_3"
result="shape"
id="feBlend204" />
</filter>
<filter
id="filter3_d_9_3"
x="14.9661"
y="34"
width="139.23"
height="266.144"
filterUnits="userSpaceOnUse"
color-interpolation-filters="sRGB">
<feFlood
flood-opacity="0"
result="BackgroundImageFix"
id="feFlood207" />
<feColorMatrix
in="SourceAlpha"
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
result="hardAlpha"
id="feColorMatrix209" />
<feOffset
id="feOffset211" />
<feGaussianBlur
stdDeviation="2"
id="feGaussianBlur213" />
<feComposite
in2="hardAlpha"
operator="out"
id="feComposite215" />
<feColorMatrix
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"
id="feColorMatrix217" />
<feBlend
mode="normal"
in2="BackgroundImageFix"
result="effect1_dropShadow_9_3"
id="feBlend219" />
<feBlend
mode="normal"
in="SourceGraphic"
in2="effect1_dropShadow_9_3"
result="shape"
id="feBlend221" />
</filter>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

@ -0,0 +1,94 @@
# install_prefs.py
#
# Copyright 2022
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: GPL-3.0-only
from jade_gui.utils import disks
import json
class InstallPrefs:
def __init__(
self,
timezone,
layout,
variant,
username,
password,
enable_sudo,
disk,
hostname,
ipv_enabled,
timeshift_enable,
desktop,
):
self.timezone = timezone
self.layout = layout
self.variant = variant
self.username = username
self.password = password
self.enable_sudo = enable_sudo
self.disk = disk.disk
self.hostname = hostname if len(hostname) != 0 else "crystal"
self.ipv_enabled = ipv_enabled
self.timeshift_enable = timeshift_enable
self.desktop = desktop
self.is_efi = disks.get_uefi()
self.bootloader_type = "grub-efi" if self.is_efi else "grub-legacy"
self.bootloader_location = "/boot/efi" if self.is_efi else self.disk
def generate_json(self):
prefs = {
"partition": {
"device": self.disk,
"mode": "Auto",
"efi": self.is_efi,
"partitions": "",
},
"bootloader": {
"type": self.bootloader_type,
"location": self.bootloader_location,
},
"locale": {
"locale": [
self.timezone.locale
],
"keymap": self.layout.country_shorthand,
"timezone": self.timezone.region+"/"+self.timezone.location,
},
"networking": {
"hostname": self.hostname,
"ipv6": self.ipv_enabled,
},
"users": [
{
"name": self.username,
"password": self.password,
"hasroot": self.enable_sudo,
},
],
"rootpass": self.password,
"desktop": self.desktop.lower(),
"unakite": {
"enable": False,
"root": "/dev/null",
"oldroot": self.disk,
"efidir": "/dev/null",
"bootdev": "/dev/null",
},
"kernel": "linux"
}
return json.dumps(prefs)

@ -5,5 +5,6 @@ jade_gui_sources = [
'__init__.py',
'locale.py',
'keymap.py',
'install_prefs.py',
]
install_data(jade_gui_sources, install_dir: classesdir)

@ -17,8 +17,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from gi.repository import Gtk, Adw
import subprocess, os
import asyncio
from gi.repository import Gtk, GLib, Adw
from gettext import gettext as _
@Gtk.Template(resource_path='/al/getcryst/jadegui/pages/install_screen.ui')
@ -29,4 +30,18 @@ class InstallScreen(Adw.Bin):
def __init__(self, window, main_carousel, next_page, application, **kwargs):
super().__init__(**kwargs)
self.log_text.set_text("tsarnitasnri\ntnaoietnioer\ntsarnitoarsn\ntisratnoisr")
self.window = window
def install(self):
prefs = self.window.summary_screen.installprefs.generate_json()
with open(os.getenv("HOME")+"/test.log", "wb") as f:
process = subprocess.Popen(["bash", "-c", "bash -- /app/share/jade_gui/jade_gui/scripts/install.sh"], stdout=subprocess.PIPE)
for c in iter(lambda: process.stdout.read(1), b""):
log=c
GLib.idle_add(self.update_output, c.decode("utf-8"))
f.write(c)
def update_output(self, message):
log=self.log_text.get_label()
new_log=f"{log}{message}"
self.log_text.set_label(new_log)

@ -27,7 +27,7 @@ class MiscScreen(Adw.Bin):
hostname_entry = Gtk.Template.Child()
ipv_switch = Gtk.Template.Child()
timeshift_switch = Gtk.Template.Child()
theme_switch = Gtk.Template.Child()
#theme_switch = Gtk.Template.Child()
next_page_button = Gtk.Template.Child()
hostname = "crystal"
@ -46,7 +46,7 @@ class MiscScreen(Adw.Bin):
def carousel_next(self, widget):
self.hostname = self.hostname_entry.get_text()
self.ipv_enabled = self.ipv_switch.get_state()
self.crystal_theming_enabled = self.theme_switch.get_state()
#self.crystal_theming_enabled = self.theme_switch.get_state()
self.timeshift_enabled = self.timeshift_switch.get_state()
if self.move_to_summary:
self.window.summary_screen.initialize()

@ -17,7 +17,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import subprocess
from jade_gui.utils import disks
from jade_gui.classes.install_prefs import InstallPrefs
from jade_gui.utils.threading import RunAsync
from gi.repository import Gtk, Adw
from gettext import gettext as _
@ -25,6 +28,8 @@ from gettext import gettext as _
class SummaryScreen(Adw.Bin):
__gtype_name__ = "SummaryScreen"
next_page_button = Gtk.Template.Child()
timezone_label = Gtk.Template.Child()
timezone_button = Gtk.Template.Child()
keyboard_label = Gtk.Template.Child()
@ -44,13 +49,20 @@ class SummaryScreen(Adw.Bin):
ipv_button = Gtk.Template.Child()
timeshift_label = Gtk.Template.Child()
timeshift_button = Gtk.Template.Child()
theme_label = Gtk.Template.Child()
theme_button = Gtk.Template.Child()
#unakite_label = Gtk.Template.Child()
def __init__(self, window, main_carousel, next_page, application, **kwargs):
super().__init__(**kwargs)
self.window = window
self.main_carousel = main_carousel
self.next_page = next_page
self.next_page_button.connect("clicked", self.carousel_next)
def carousel_next(self, widget):
self.main_carousel.scroll_to(self.next_page, True)
#(self.window.installer_screen.install())
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)
def initialize(self):
self.timezone_button.connect("clicked", self.window.nextPage)
@ -62,7 +74,6 @@ class SummaryScreen(Adw.Bin):
self.partition_button.connect("clicked", self.window.desktop_screen.carousel_next_summary)
self.ipv_button.connect("clicked", self.window.desktop_screen.carousel_next_summary)
self.timeshift_button.connect("clicked", self.window.desktop_screen.carousel_next_summary)
self.theme_button.connect("clicked", self.window.desktop_screen.carousel_next_summary)
self.timezone_label.set_title(self.window.timezone_screen.chosen_timezone.region+"/"+self.window.timezone_screen.chosen_timezone.location)
self.timezone_label.set_subtitle(self.window.timezone_screen.chosen_timezone.locale)
@ -82,6 +93,20 @@ class SummaryScreen(Adw.Bin):
self.ipv_label.set_title("ipv6 enabled" if self.window.misc_screen.ipv_enabled else "ipv6 disabled")
self.timeshift_label.set_title("timeshift enabled" if self.window.misc_screen.timeshift_enabled else "timeshift disabled")
self.theme_label.set_title("Crystal theming enabled" if self.window.misc_screen.crystal_theming_enabled else "Crystal theming disabled")
#self.theme_label.set_title("Crystal theming enabled" if self.window.misc_screen.crystal_theming_enabled else "Crystal theming disabled")
#self.unakite_label.set_title("Unakite enabled "+"enabled" if self.window.misc_screen.)
self.installprefs = InstallPrefs(
timezone=self.window.timezone_screen.chosen_timezone,
layout=self.window.keyboard_screen.layout,
variant=self.window.keyboard_screen.variant,
username=self.window.user_screen.username,
password=self.window.user_screen.password,
enable_sudo=self.window.user_screen.sudo_enabled,
disk=self.window.partition_screen.selected_partition,
hostname=self.window.misc_screen.hostname,
ipv_enabled=self.window.misc_screen.ipv_enabled,
timeshift_enable=self.window.misc_screen.timeshift_enabled,
desktop=self.window.desktop_screen.chosen_desktop,
)

@ -95,6 +95,7 @@ class UserScreen(Adw.Bin):
if self.password_entry.get_text() == self.password_confirmation.get_text():
self.next_page.set_sensitive(True)
self.password_confirmation.remove_css_class('error')
self.password = self.password_entry.get_text()
elif self.password_entry.get_text() != self.password_confirmation.get_text():
self.next_page.set_sensitive(False)
self.password_confirmation.add_css_class('error')

@ -28,6 +28,7 @@ template InstallScreen : Adw.Bin {
selectable: true;
xalign: 0;
yalign: 0;
styles ["monospace", "terminal"]
}
}
}

@ -36,13 +36,13 @@ template MiscScreen : Adw.Bin {
state: true;
}
}
Adw.ActionRow {
/*Adw.ActionRow {
title: "Enable crystal theming";
Gtk.Switch theme_switch {
valign: center;
state: false;
}
}
}*/
}
}
}

@ -131,7 +131,7 @@ template SummaryScreen : Adw.Bin {
icon-name: "document-edit-symbolic";
}
}
Adw.ActionRow theme_label {
/*Adw.ActionRow theme_label {
title: "crystal theming enaled/disabled";
Gtk.Button theme_button {
valign: center;
@ -139,7 +139,7 @@ template SummaryScreen : Adw.Bin {
icon-name: "document-edit-symbolic";
}
}
/*Adw.ActionRow unakite_label {
Adw.ActionRow unakite_label {
title: "unakite enaled/disabled";
Gtk.Button {
valign: center;
@ -152,5 +152,17 @@ template SummaryScreen : Adw.Bin {
}
}
}
Gtk.Overlay {
[overlay]
Gtk.Button next_page_button {
margin-end: 20;
margin-bottom: 20;
label: "Next";
halign: end;
valign: end;
tooltip-text: "Move to next page";
styles ["suggested-action"]
}
}
}
}

@ -0,0 +1,4 @@
#!/usr/bin/bash
flatpak-spawn --host pkexec jade /tmp/jade.json
#flatpak-spawn --host echo "hi"
#flatpak-spawn --host pkexec whoami

@ -5,5 +5,7 @@ jade_gui_sources = [
'getDisks.sh',
'getDiskSize.sh',
'checkEFI.sh',
'install.sh',
'savePrefs.sh',
]
install_data(jade_gui_sources, install_dir: scriptsdir)

@ -0,0 +1,3 @@
#!/usr/bin/bash
#echo $1
flatpak-spawn --host bash -c "echo $1 > /tmp/jade.json"

@ -4,5 +4,6 @@ utilsdir = join_paths(pkgdatadir, 'jade_gui/utils')
jade_gui_sources = [
'__init__.py',
'disks.py',
'threading.py',
]
install_data(jade_gui_sources, install_dir: utilsdir)

@ -0,0 +1,74 @@
# This file was taken from bottles <https://usebottles.com> with the permission from brombinmirko
#
# threading.py
#
# Copyright 2022 brombinmirko <send@mirko.pm>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, in version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import sys
import threading
import traceback
from gettext import gettext as _
from gi.repository import GLib
class RunAsync(threading.Thread):
"""
This class is used to execute a function asynchronously.
It takes a function, a callback and a list of arguments as input.
"""
def __init__(self, task_func, callback=None, *args, **kwargs):
if "DEBUG_MODE" in os.environ:
import faulthandler
faulthandler.enable()
self.source_id = None
assert threading.current_thread() is threading.main_thread()
super(RunAsync, self).__init__(
target=self.__target, args=args, kwargs=kwargs)
self.task_func = task_func
self.callback = callback if callback else lambda r, e: None
self.daemon = kwargs.pop("daemon", True)
self.start()
def __target(self, *args, **kwargs):
result = None
error = None
print(f"DEBUG: Running async job [{self.task_func}].")
try:
result = self.task_func(*args, **kwargs)
except Exception as exception:
print("ERROR: while running async job: "
f"{self.task_func}\nException: {exception}")
error = exception
_ex_type, _ex_value, trace = sys.exc_info()
traceback.print_tb(trace)
traceback_info = '\n'.join(traceback.format_tb(trace))
print([str(exception), traceback_info])
self.source_id = GLib.idle_add(self.callback, result, error)
return self.source_id
Loading…
Cancel
Save