Start autostart launches in tray
Add a shared --start-in-tray argument that lets autostart start the scheduler and tray integration without opening the main window. Write the argument into Windows Startup shortcuts and Linux XDG Autostart desktop entries, and verify existing autostart entries include it. Keep manual launches unchanged and let a manual second launch reveal an already-running instance while duplicate autostart launches stay hidden.
This commit is contained in:
+16
-2
@@ -1,10 +1,24 @@
|
||||
package main
|
||||
|
||||
import "github.com/pysentry/pysentry/src/gui"
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/pysentry/pysentry/src/core"
|
||||
"github.com/pysentry/pysentry/src/gui"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// The executable entry point intentionally delegates all startup work to the
|
||||
// GUI package. Keeping main small makes it easier to add platform-specific
|
||||
// packaging later without mixing window setup, storage, and scheduler logic.
|
||||
gui.Run()
|
||||
gui.Run(hasArgument(core.StartInTrayArgument))
|
||||
}
|
||||
|
||||
func hasArgument(argument string) bool {
|
||||
for _, current := range os.Args[1:] {
|
||||
if current == argument {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user