mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 21:29:11 +00:00
Show splash screen on app start. Only supported on Windows, Linux
This commit is contained in:
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -35,7 +35,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [ "$RUNNER_OS" == "Linux" ]; then
|
if [ "$RUNNER_OS" == "Linux" ]; then
|
||||||
sudo apt install libegl1 libxcb-xinerama0 -y
|
sudo apt install libegl1 libxcb-xinerama0 python3-tk -y
|
||||||
fi
|
fi
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install pyinstaller
|
pip install pyinstaller
|
||||||
|
|||||||
82
Khoj.spec
82
Khoj.spec
@@ -43,30 +43,66 @@ a.datas = [entry for entry in a.datas if not entry[0] in torch_lib_paths]
|
|||||||
|
|
||||||
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
||||||
|
|
||||||
exe = EXE(
|
if system() != 'Darwin':
|
||||||
pyz,
|
# Add Splash screen to show on app launch
|
||||||
a.scripts,
|
splash = Splash(
|
||||||
a.binaries,
|
'src/interface/web/assets/icons/favicon-144x144.png',
|
||||||
a.zipfiles,
|
binaries=a.binaries,
|
||||||
a.datas,
|
datas=a.datas,
|
||||||
[],
|
text_pos=(10, 50),
|
||||||
name='Khoj',
|
text_size=12,
|
||||||
debug=False,
|
text_color='blue',
|
||||||
bootloader_ignore_signals=False,
|
minify_script=True,
|
||||||
strip=False,
|
always_on_top=True
|
||||||
upx=True,
|
)
|
||||||
upx_exclude=[],
|
|
||||||
runtime_tmpdir=None,
|
|
||||||
console=False,
|
|
||||||
disable_windowed_traceback=False,
|
|
||||||
argv_emulation=False,
|
|
||||||
target_arch='x86_64',
|
|
||||||
codesign_identity=None,
|
|
||||||
entitlements_file=None,
|
|
||||||
icon='src/interface/web/assets/icons/favicon.icns',
|
|
||||||
)
|
|
||||||
|
|
||||||
if system() == 'Darwin':
|
exe = EXE(
|
||||||
|
pyz,
|
||||||
|
a.scripts,
|
||||||
|
a.binaries,
|
||||||
|
a.zipfiles,
|
||||||
|
a.datas,
|
||||||
|
splash,
|
||||||
|
splash.binaries,
|
||||||
|
[],
|
||||||
|
name='Khoj',
|
||||||
|
debug=False,
|
||||||
|
bootloader_ignore_signals=False,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
upx_exclude=[],
|
||||||
|
runtime_tmpdir=None,
|
||||||
|
console=False,
|
||||||
|
disable_windowed_traceback=False,
|
||||||
|
argv_emulation=False,
|
||||||
|
target_arch='x86_64',
|
||||||
|
codesign_identity=None,
|
||||||
|
entitlements_file=None,
|
||||||
|
icon='src/interface/web/assets/icons/favicon.icns',
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
exe = EXE(
|
||||||
|
pyz,
|
||||||
|
a.scripts,
|
||||||
|
a.binaries,
|
||||||
|
a.zipfiles,
|
||||||
|
a.datas,
|
||||||
|
[],
|
||||||
|
name='Khoj',
|
||||||
|
debug=False,
|
||||||
|
bootloader_ignore_signals=False,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
upx_exclude=[],
|
||||||
|
runtime_tmpdir=None,
|
||||||
|
console=False,
|
||||||
|
disable_windowed_traceback=False,
|
||||||
|
argv_emulation=False,
|
||||||
|
target_arch='x86_64',
|
||||||
|
codesign_identity=None,
|
||||||
|
entitlements_file=None,
|
||||||
|
icon='src/interface/web/assets/icons/favicon.icns',
|
||||||
|
)
|
||||||
app = BUNDLE(
|
app = BUNDLE(
|
||||||
exe,
|
exe,
|
||||||
name='Khoj.app',
|
name='Khoj.app',
|
||||||
|
|||||||
12
src/main.py
12
src/main.py
@@ -67,6 +67,18 @@ def run():
|
|||||||
# Start Application
|
# Start Application
|
||||||
server.start()
|
server.start()
|
||||||
gui.aboutToQuit.connect(server.terminate)
|
gui.aboutToQuit.connect(server.terminate)
|
||||||
|
|
||||||
|
# Close Splash Screen if still open
|
||||||
|
if system() != 'Darwin':
|
||||||
|
try:
|
||||||
|
import pyi_splash
|
||||||
|
# Update the text on the splash screen
|
||||||
|
pyi_splash.update_text("Khoj setup complete")
|
||||||
|
# Close Splash Screen
|
||||||
|
pyi_splash.close()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
gui.exec()
|
gui.exec()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user