From 62b7b4f90eafe37a207d043912e384d065287e6d Mon Sep 17 00:00:00 2001 From: piotr Date: Sat, 25 Sep 2021 01:41:39 +0200 Subject: [PATCH] comments --- main.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 2b8c783..83492ae 100644 --- a/main.go +++ b/main.go @@ -173,9 +173,11 @@ func main() { } }() - // If running instance found and running residently, we want it to refresh and show the window. - // Otherwise we want the same command to terminate the drawer: kill the running instance and exit. - //lockFilePath := fmt.Sprintf("%s/nwg-drawer.lock", tempDir()) + // If running instance found, we want it to show the window. The new instance will send SIGUSR1 and die + // (equivalent of `pkill -USR1 nwg-drawer`). + // 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") lockFile, err := singleinstance.CreateLockFile(lockFilePath) if err != nil {