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:convert';
import 'dart:io'; import 'dart:io';
test(setOutput) async { test(setOutput, running, setRunning, config) async {
var process = await Process.start('./scripts/jadeemu.sh', []); 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); process.stdout.transform(utf8.decoder).forEach(setOutput);
setRunning(true);
}
} }
Widget install( Widget install(
@ -27,8 +33,9 @@ Widget install(
bool enableTimeshift, bool enableTimeshift,
setOutput, setOutput,
output, output,
running,
setRunning,
) { ) {
test(setOutput);
installPrefs prefs = installPrefs( installPrefs prefs = installPrefs(
locale: locale, locale: locale,
keymap: keymap, keymap: keymap,
@ -46,7 +53,8 @@ Widget install(
enableTimeshift: enableTimeshift, enableTimeshift: enableTimeshift,
); );
String jsonPrefs = jsonEncode(prefs.toJson()); String jsonPrefs = jsonEncode(prefs.toJson());
print(jsonPrefs); //writeConfig(jsonPrefs);
test(setOutput, running, setRunning, jsonPrefs);
return Column( return Column(
children: [ children: [
const Text( const Text(
@ -59,11 +67,53 @@ Widget install(
const SizedBox( const SizedBox(
height: 20, height: 20,
), ),
SingleChildScrollView( const SizedBox(width: 40),
child: Text(output, 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( 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), color: Color.fromARGB(255, 169, 0, 255),
)), ),
), ),
], ],
); );

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

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

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