Light simplication of process forking.
1 files changed, 3 insertions(+), 9 deletions(-)

M main.go
M main.go +3 -9
@@ 4,7 4,7 @@ import (
 	"flag"
 	"fmt"
 	"log"
-	"os"
+	"os/exec"
 	"strings"
 	"sync"
 

          
@@ 63,8 63,8 @@ func (c con) toggleQuake(pos int, ratio 
 		if cmd == "" {
 			cmd = "st"
 		}
+		com := exec.Command(cmd)
 		i3ipc.StartEventListener()
-		var proc *os.Process
 		evts, err := i3ipc.Subscribe(i3ipc.I3WindowEvent)
 		if err != nil {
 			panic(err)

          
@@ 85,7 85,6 @@ func (c con) toggleQuake(pos int, ratio 
 							panic(err)
 						}
 						c.position(pos, ratio)
-						proc.Release()
 						w.Done()
 						return
 					default:

          
@@ 96,12 95,7 @@ func (c con) toggleQuake(pos int, ratio 
 		}()
 		w.Wait()
 		w.Add(1)
-		proc, err = os.StartProcess(cmd, nil, &os.ProcAttr{
-			Files: []*os.File{os.Stdin, os.Stdout, os.Stderr},
-		})
-		if err != nil {
-			panic(err)
-		}
+		com.Start()
 		w.Wait()
 	} else {
 		cmd := fmt.Sprintf(`[con_mark="%s"], scratchpad show`, NAME)