mirror of
https://github.com/stashapp/stash.git
synced 2025-12-13 20:03:02 +01:00
* Rename manager.instance to Manager * Show dialog message on fatal error on Windows * Hide console windows explicitly on icon launch Gets rid of the windowsgui flag, which causes all sorts of issues. Instead, checks if stash was launched from the icon, and if so hides the console. * Remove fixconsole * Add changelog entries
47 lines
945 B
Go
47 lines
945 B
Go
//go:build linux || freebsd
|
|
// +build linux freebsd
|
|
|
|
package desktop
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"os"
|
|
"os/exec"
|
|
"strings"
|
|
|
|
"github.com/stashapp/stash/pkg/logger"
|
|
)
|
|
|
|
// isService checks if started by init, e.g. stash is a *nix systemd service
|
|
func isService() bool {
|
|
return os.Getppid() == 1
|
|
}
|
|
|
|
func isServerDockerized() bool {
|
|
_, dockerEnvErr := os.Stat("/.dockerenv")
|
|
cgroups, _ := ioutil.ReadFile("/proc/self/cgroup")
|
|
if !os.IsNotExist(dockerEnvErr) || strings.Contains(string(cgroups), "docker") {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
func sendNotification(notificationTitle string, notificationText string) {
|
|
err := exec.Command("notify-send", "-i", getIconPath(), notificationTitle, notificationText, "-a", "Stash").Run()
|
|
if err != nil {
|
|
logger.Errorf("Error sending notification on Linux: %s", err.Error())
|
|
}
|
|
}
|
|
|
|
func revealInFileManager(path string) {
|
|
|
|
}
|
|
|
|
func isDoubleClickLaunched() bool {
|
|
return false
|
|
}
|
|
|
|
func hideConsole() {
|
|
|
|
}
|