autoplank icon indicating copy to clipboard operation
autoplank copied to clipboard

Plank position update fix and more

Open 7aske opened this issue 6 years ago • 4 comments

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.

7aske avatar Sep 18 '19 04:09 7aske

Tested. Works :)

spotlesscoder avatar Sep 20 '19 05:09 spotlesscoder

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

spotlesscoder avatar Sep 20 '19 14:09 spotlesscoder

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.

7aske avatar Sep 20 '19 14:09 7aske

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.

7aske avatar Sep 20 '19 16:09 7aske