mirror of
https://github.com/rozniak/xfce-winxp-tc.git
synced 2026-01-26 11:39:44 +00:00
Prelim: Startup stuff for setup autorun
This commit is contained in:
10
base/setup/initial/autorun/main.py
Normal file
10
base/setup/initial/autorun/main.py
Normal 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)
|
||||
21
base/setup/initial/autorun/warapp.py
Normal file
21
base/setup/initial/autorun/warapp.py
Normal 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()
|
||||
16
base/setup/initial/autorun/warwndar.py
Normal file
16
base/setup/initial/autorun/warwndar.py
Normal 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()
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user