Prelim: Startup stuff for setup autorun

This commit is contained in:
Rory Fewell
2025-06-27 21:02:21 +01:00
parent bb0ac39919
commit c07d4316d6
4 changed files with 58 additions and 7 deletions

View File

@@ -0,0 +1,10 @@
import sys
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
from warapp import WinTCAutorunApplication
if __name__ == "__main__":
app = WinTCAutorunApplication()
app.run(sys.argv)

View File

@@ -0,0 +1,21 @@
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
from warwndar import WinTCAutorunWindow
class WinTCAutorunApplication(Gtk.Application):
def __init__(self, *args, **kwargs):
super().__init__(
*args,
application_id="uk.oddmatics.wintc.autorun",
**kwargs
)
self.window_startup = None
def do_activate(self):
if not self.window_startup:
self.window_startup = WinTCAutorunWindow(application=self)
self.window_startup.present()

View File

@@ -0,0 +1,16 @@
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
class WinTCAutorunWindow(Gtk.ApplicationWindow):
def __init__(self, *args, **kwargs):
super().__init__(
*args,
title="Windows Setup",
**kwargs
)
self.testlabel = Gtk.Label(label="Welcome to Windows WinTC")
self.add(self.testlabel)
self.show_all()

View File

@@ -19,10 +19,15 @@ python_path=`which python 2>/dev/null`
if [ $? != 0 ]
then
printf "%s%s\n" \
"Your system is missing the Python 3 interpreter, this is required " \
"by setup. Setup will now exit.";
exit 1;
python_path=`which python3 2>/dev/null`
if [ $? != 0 ]
then
printf "%s%s\n" \
"Your system is missing the Python 3 interpreter, this is " \
"required by setup. Setup will now exit.";
exit 1;
fi
fi
# Inspect the distro
@@ -36,8 +41,7 @@ export DIST_ID_EXT
#
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]
then
$python_path textmode/main.py;
$python_path textmode/main.py
else
printf "%s\n" "GUI mode setup is not yet implemented. Sorry!"
exit 1
$python_path autorun/main.py
fi