feat: add system tray and __main__ entry point
Add pystray-based system tray icon with Open UI / Restart / Quit actions. Add __main__.py for `python -m wled_controller` support. Update start-hidden.vbs with embedded Python fallback for both installed and dev environments.
This commit is contained in:
@@ -18,7 +18,7 @@ cd /d "%~dp0\.."
|
||||
REM Start the server
|
||||
echo.
|
||||
echo [2/2] Starting server...
|
||||
python -m uvicorn wled_controller.main:app --host 0.0.0.0 --port 8080
|
||||
python -m wled_controller
|
||||
|
||||
REM If the server exits, pause to show any error messages
|
||||
pause
|
||||
|
||||
13
server/scripts/start-hidden.vbs
Normal file
13
server/scripts/start-hidden.vbs
Normal file
@@ -0,0 +1,13 @@
|
||||
Set fso = CreateObject("Scripting.FileSystemObject")
|
||||
Set WshShell = CreateObject("WScript.Shell")
|
||||
' Get the directory of this script (scripts\), then go up to app root
|
||||
scriptDir = fso.GetParentFolderName(WScript.ScriptFullName)
|
||||
appRoot = fso.GetParentFolderName(scriptDir)
|
||||
WshShell.CurrentDirectory = appRoot
|
||||
' Use embedded Python if present (installed dist), otherwise system Python
|
||||
embeddedPython = appRoot & "\python\pythonw.exe"
|
||||
If fso.FileExists(embeddedPython) Then
|
||||
WshShell.Run """" & embeddedPython & """ -m wled_controller", 0, False
|
||||
Else
|
||||
WshShell.Run "python -m wled_controller", 0, False
|
||||
End If
|
||||
@@ -2,6 +2,6 @@ Set WshShell = CreateObject("WScript.Shell")
|
||||
Set FSO = CreateObject("Scripting.FileSystemObject")
|
||||
' Get parent folder of scripts folder (server root)
|
||||
WshShell.CurrentDirectory = FSO.GetParentFolderName(FSO.GetParentFolderName(WScript.ScriptFullName))
|
||||
WshShell.Run "python -m uvicorn wled_controller.main:app --host 0.0.0.0 --port 8080", 0, False
|
||||
WshShell.Run "python -m wled_controller", 0, False
|
||||
Set FSO = Nothing
|
||||
Set WshShell = Nothing
|
||||
|
||||
@@ -9,7 +9,7 @@ REM Change to the server directory (parent of scripts folder)
|
||||
cd /d "%~dp0\.."
|
||||
|
||||
REM Start the server
|
||||
python -m uvicorn wled_controller.main:app --host 0.0.0.0 --port 8080
|
||||
python -m wled_controller
|
||||
|
||||
REM If the server exits, pause to show any error messages
|
||||
pause
|
||||
|
||||
Reference in New Issue
Block a user