does it work? I certainly hope it does

pull/2/head
axtlos 3 years ago
parent 952feda27e
commit 6dcfbfa47a

@ -5,9 +5,15 @@ import 'package:jade_gui/classes/location.dart';
import 'dart:convert';
import 'dart:io';
test(setOutput) async {
var process = await Process.start('./scripts/jadeemu.sh', []);
test(setOutput, running, setRunning, config) async {
if (!running) {
const filename = "/tmp/jade.json";
var file = await File(filename).writeAsString(config);
var process =
await Process.start('pkexec', ['jade', 'config', '/tmp/jade.json']);
process.stdout.transform(utf8.decoder).forEach(setOutput);
setRunning(true);
}
}
Widget install(
@ -27,8 +33,9 @@ Widget install(
bool enableTimeshift,
setOutput,
output,
running,
setRunning,
) {
test(setOutput);
installPrefs prefs = installPrefs(
locale: locale,
keymap: keymap,
@ -46,7 +53,8 @@ Widget install(
enableTimeshift: enableTimeshift,
);
String jsonPrefs = jsonEncode(prefs.toJson());
print(jsonPrefs);
//writeConfig(jsonPrefs);
test(setOutput, running, setRunning, jsonPrefs);
return Column(
children: [
const Text(
@ -59,11 +67,53 @@ Widget install(
const SizedBox(
height: 20,
),
SingleChildScrollView(
child: Text(output,
const SizedBox(width: 40),
Container(
width: 1000,
height: 500,
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
border: Border.all(color: Colors.black),
color: Color.fromARGB(255, 15, 15, 15),
//color: Colors.black,
/*boxShadow: const [
BoxShadow(
color: Colors.black,
blurRadius: 2,
offset: Offset(-2, 3),
),
]*/
),
child: SingleChildScrollView(
reverse: true,
child: Text(
output,
style: const TextStyle(
color: Colors.white,
fontSize: 15,
fontFamily: 'Monospace',
fontWeight: FontWeight.w100,
),
),
),
),
const SizedBox(height: 20),
Text(
"This may take a while...",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Color.fromARGB(255, 169, 0, 255),
)),
),
),
Text(
"Please do not close this window until the installation is finished.",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Color.fromARGB(255, 169, 0, 255),
),
),
],
);

@ -50,6 +50,7 @@ class _JadeguiState extends State<Jadegui> {
bool isEfi = false;
bool ipv6 = false;
bool enableTimeshift = true;
bool running = false;
String password = "";
String confirmPassword = "";
String username = "";
@ -483,7 +484,12 @@ class _JadeguiState extends State<Jadegui> {
});
},
output,
);
running,
(value) {
setState(() {
running = value;
});
});
break;
default:
widget = const Text(

@ -0,0 +1,2 @@
#!/usr/bin/bash
echo $(cat $1)

@ -1,4 +1,6 @@
#!/usr/bin/bash
whoami
sleep 0.1
echo "[LOG] doing thing"
sleep 0.1
echo "[ERROR] failed doing thing"
@ -7,3 +9,103 @@ echo "[LOG]"
sleep 0.1
echo "[ERROR]"
sleep 1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1
echo "[LOG]"
sleep 0.1

Loading…
Cancel
Save