This commit is contained in:
piotr
2021-09-25 01:41:39 +02:00
parent 97c0e0c972
commit 62b7b4f90e

View File

@@ -173,9 +173,11 @@ func main() {
} }
}() }()
// If running instance found and running residently, we want it to refresh and show the window. // If running instance found, we want it to show the window. The new instance will send SIGUSR1 and die
// Otherwise we want the same command to terminate the drawer: kill the running instance and exit. // (equivalent of `pkill -USR1 nwg-drawer`).
//lockFilePath := fmt.Sprintf("%s/nwg-drawer.lock", tempDir()) // Otherwise the command may behave in two ways:
// 1. kill the running non-residennt instance and exit;
// 2. die if a resident instance found.
lockFilePath := path.Join(tempDir(), "nwg-drawer.lock") lockFilePath := path.Join(tempDir(), "nwg-drawer.lock")
lockFile, err := singleinstance.CreateLockFile(lockFilePath) lockFile, err := singleinstance.CreateLockFile(lockFilePath)
if err != nil { if err != nil {