Open 7aske opened 5 years ago
Tested. Works :)
When the autoplank executable exits, plank goes away completely. (At least when I test autoplank by manually invoking it from command line and pressing Ctrl+C) I think it should launch a plank instance that stays alive after exit when Ctrl+C signal is sent
Yup just reviewed the changes. There is a leftover exec.Command call
plank, _ := exec.LookPath("plank")
var attr = os.ProcAttr{Dir: ".", Env: os.Environ(), Files: []*os.File{nil, nil, nil, nil}}
process, err := os.StartProcess(plank, []string{}, &attr)
if err != nil {
fmt.Printf(err.Error())
} else {
err = process.Release()
if err != nil {
fmt.Printf(err.Error())
}
}
exec.Command("plank")
Will look into it now.
As far I have figured process.Release()
doesn't seem to do anything. Child process still dies with parent exits. I kind of don't wanna solve this by calling a external script.
Plank didnt seem to update after writing to dconf. My solution was to simple restart the plank process. I added plank to the list of required commands and made it so that it runs on start. Also figured that querying xrandr caused spikes and locking of the screen for about 3 frames which I think is unacceptable so xrandr is only queried at the start of the program. Assumption is that user will not be not be adding/removing/reconfiguring screens all the time. Added a makefile for easier installation/build.