chore: migrate and structure cmbone project
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"cmbone/internal/services"
|
||||
"embed"
|
||||
"log"
|
||||
|
||||
"github.com/wailsapp/wails/v3/pkg/application"
|
||||
)
|
||||
|
||||
//go:embed all:frontend/dist
|
||||
var assets embed.FS
|
||||
|
||||
//go:embed frontend/src/locales/*.json
|
||||
var i18nFS embed.FS
|
||||
|
||||
func main() {
|
||||
store, err := services.NewSuiStore()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer store.Close()
|
||||
|
||||
appService := &services.AppService{}
|
||||
app := application.New(application.Options{
|
||||
Name: "cmbone",
|
||||
Description: "A Wails desktop application",
|
||||
Services: []application.Service{
|
||||
application.NewService(appService),
|
||||
application.NewService(services.NewHotkeyService(store)),
|
||||
application.NewService(services.NewSystemInfo()),
|
||||
application.NewService(services.NewAppConfigService(store)),
|
||||
application.NewService(&services.OCRService{}),
|
||||
},
|
||||
Assets: application.AssetOptions{
|
||||
Handler: application.AssetFileServerFS(assets),
|
||||
},
|
||||
Mac: application.MacOptions{
|
||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||
},
|
||||
})
|
||||
|
||||
services.ConfigureAppService(appService, app, i18nFS, store)
|
||||
services.LoadAndRegisterHotkeysFrom(store, services.HotkeyShowSecondWindow)
|
||||
|
||||
if err := app.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user