1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2025-01-03 15:00:12 +00:00

fix 'jfa-go systemd' layout

lines were printing out-of-order for some reason, so i added time.Sleep
between them.
This commit is contained in:
Harvey Tindall 2021-07-27 10:47:07 +01:00
parent 1a6b0d2b6e
commit 67c60cb677
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2

15
main.go
View File

@ -719,17 +719,24 @@ func main() {
fmt.Printf("Couldn't write jfa-go.service: %v\n", err)
os.Exit(1)
}
fmt.Print(info(`If you want to execute jfa-go with special arguments, re-run this command with them.
fmt.Println(info(`If you want to execute jfa-go with special arguments, re-run this command with them.
Move the newly created "jfa-go.service" file to ~/.config/systemd/user (Creating it if necessary).
Then run "systemctl --user daemon-reload".
You can then run:
`))
color.New(color.FgGreen).PrintFunc()("To start: ")
// I have no idea why sleeps are necessary, but if not the lines print in the wrong order.
time.Sleep(time.Millisecond)
color.New(color.FgGreen).Print("To start: ")
time.Sleep(time.Millisecond)
fmt.Print(info("systemctl --user start jfa-go\n\n"))
color.New(color.FgRed).PrintFunc()("To stop: ")
time.Sleep(time.Millisecond)
color.New(color.FgRed).Print("To stop: ")
time.Sleep(time.Millisecond)
fmt.Print(info("systemctl --user stop jfa-go\n\n"))
color.New(color.FgYellow).PrintFunc()("To restart: ")
time.Sleep(time.Millisecond)
color.New(color.FgYellow).Print("To restart: ")
time.Sleep(time.Millisecond)
fmt.Print(info("systemctl --user stop jfa-go\n"))
} else if TRAY {
RunTray()