Skip to content

Commit

Permalink
Update index.py
Browse files Browse the repository at this point in the history
Works on Arch Linux now (probably any distro now)
And adapts to screen size
  • Loading branch information
MTSyntho authored Dec 10, 2024
1 parent ea0014a commit de19227
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions index.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import subprocess
import os
import pathlib
from screeninfo import get_monitors

class Api:
def get_wifi_networks(self):
Expand Down Expand Up @@ -42,17 +43,21 @@ 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...')

# Instantiate Api class
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)
webview.start(debug=True)

0 comments on commit de19227

Please sign in to comment.