From de192278c7cda9fb6a59b0bf1a82804957e964a7 Mon Sep 17 00:00:00 2001 From: MTSyntho Date: Wed, 11 Dec 2024 01:11:00 +0200 Subject: [PATCH] Update index.py Works on Arch Linux now (probably any distro now) And adapts to screen size --- index.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/index.py b/index.py index 42cba45..10ad32d 100644 --- a/index.py +++ b/index.py @@ -2,6 +2,7 @@ import subprocess import os import pathlib +from screeninfo import get_monitors class Api: def get_wifi_networks(self): @@ -42,6 +43,8 @@ def fetch_file(self, type, path): else: return 'file://' + path +primaryMonitor = next((m for m in get_monitors() if +m.is_primary), None) print('Starting AzuOS...') @@ -49,10 +52,12 @@ def fetch_file(self, type, path): api = Api() webview.settings = { - 'ALLOW_FILE_URLS': True + 'ALLOW_FILE_URLS': True, + 'ALLOW_DOWNLOADS': True, + 'OPEN_DEVTOOLS_IN_DEBUG': False } -# webview.create_window('AzuOS', url="index.html", background_color='#000000', fullscreen=True, js_api=api) +webview.create_window('AzuOS', url="index.html", background_color='#000000', fullscreen=True, js_api=api, width=primaryMonitor.width, height=primaryMonitor.height) -webview.create_window('AzuOS', url="index.html", background_color='#000000', js_api=api) +# webview.create_window('AzuOS', url="index.html", background_color='#000000', js_api=api) -webview.start(debug=True) \ No newline at end of file +webview.start(debug=True)