Desktop integration (#2073)

* Open stash in system tray on Windows/MacOS
* Add desktop notifications
* MacOS Bundling
* Add binary icon

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
kermieisinthehouse
2022-02-02 16:20:34 -08:00
committed by GitHub
parent e48b2ba3e8
commit 0e514183a7
306 changed files with 29542 additions and 4792 deletions

16
main.go
View File

@@ -3,13 +3,14 @@ package main
import (
"embed"
"fmt"
"os"
"os/signal"
"runtime/pprof"
"syscall"
"github.com/apenwarr/fixconsole"
"github.com/stashapp/stash/pkg/api"
"github.com/stashapp/stash/pkg/logger"
"github.com/stashapp/stash/pkg/manager"
_ "github.com/golang-migrate/migrate/v4/database/sqlite3"
@@ -22,6 +23,14 @@ var uiBox embed.FS
//go:embed ui/login
var loginUIBox embed.FS
func init() {
// On Windows, attach to parent shell
err := fixconsole.FixConsoleIfNeeded()
if err != nil {
fmt.Printf("FixConsoleOutput: %v\n", err)
}
}
func main() {
manager.Initialize()
api.Start(uiBox, loginUIBox)
@@ -30,10 +39,7 @@ func main() {
defer pprof.StopCPUProfile()
blockForever()
err := manager.GetInstance().Shutdown()
if err != nil {
logger.Errorf("Error when closing: %s", err)
}
manager.GetInstance().Shutdown(0)
}
func blockForever() {