This commit is contained in:
2025-09-02 19:21:03 +02:00
parent 7bf88d9d8c
commit fdc019a200
9 changed files with 94 additions and 15 deletions

View File

@@ -2,12 +2,19 @@ package main
import (
"cloudsave/pkg/tools/windows"
_ "embed"
"os"
"github.com/getlantern/systray"
)
const defaultDocumentRoot string = "C:/ProgramData/CloudSave"
const defaultDocumentRoot string = "C:\\ProgramData\\CloudSave"
//go:embed res/icon.ico
var icon []byte
func main() {
go systray.Run(onReady, onExit)
run()
}
@@ -15,3 +22,20 @@ func fatal(message string, exitCode int) {
windows.MessageBox(windows.NULL, message, "CloudSave", windows.MB_OK)
os.Exit(exitCode)
}
func onReady() {
systray.SetTitle("CloudSave")
systray.SetTooltip("CloudSave")
systray.SetIcon(icon)
mQuit := systray.AddMenuItem("Quit", "Quit")
go func() {
<-mQuit.ClickedCh
os.Exit(0)
}()
}
func onExit() {
// clean up here
}