Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoplank not doing anything #10

Open
Simbaclaws opened this issue Nov 30, 2019 · 4 comments
Open

Autoplank not doing anything #10

Simbaclaws opened this issue Nov 30, 2019 · 4 comments

Comments

@Simbaclaws
Copy link

Hi,

I'm on manjaro with XFCE and I'm trying to move my plank from my left monitor (DP-0) to my right (HDMI-0) and back. But for some reason my plank dock doesn't move at all. It won't go to the other monitor.

I've tried starting autoplank from the terminal but it displays no information it just sits idle, even if I try to change my mouse to the other monitor and go to the bottom of it.

Do you perhaps know how I can debug this?

Yours grateful,
Simbaclaws

@raduburla
Copy link

Hi,

I had a similar issue on Pop!_OS 19.10 running Plank 0.11.89. Plank was not moving, it just printed in the terminal "attempting to move plank to ..." so i did a minor modification to the code.

This is a quick fix to get you going, I am not a GO developer, just debugged a little and noticed that when i change offset, plank moves to the other monitor.

Above function movePlankTo add this:

const dconfPlankOffset = "/net/launchpad/plank/docks/dock1/offset"

And inside the function movePlankTo replace

return exec.Command("dconf", "write", dconfPlank, value).Run()

With

cmdOffset := exec.Command("dconf", "read", dconfPlankOffset)
offsOut, offsErr := cmdOffset.Output()
if offsErr != nil {
	return offsErr
}
exec.Command("dconf", "write", dconfPlank, value).
	Run()

if strings.TrimSpace(string(offsOut)) == "0" {
	return exec.Command("dconf", "write", dconfPlankOffset, "1").
	Run()
}

return exec.Command("dconf", "write", dconfPlankOffset, "0").
	Run()

After this, rebuild and run/restart autoplank

@Simbaclaws
Copy link
Author

Thanks a lot!! I haven't tested it yet, but will try so as soon as possible. This would really make my life easier. Greatly appreciated.

@Simbaclaws
Copy link
Author

Simbaclaws commented Dec 10, 2019

This seems to work, can this be merged with master?
I'll make a fork just in case...

@lord-kyron
Copy link

Hi guys, I using elementary os 5.1 and trying to use autoplank, but it does nothing and starting from cli gives me:
panic: runtime error: index out of range

goroutine 5 [running]:
main.fetchDisplays(0x0, 0x0, 0x0, 0x0, 0x0)
/root/autoplank/main.go:193 +0x742
main.watchDisplays()
/root/autoplank/main.go:109 +0x26
created by main.eventLoop
/root/autoplank/main.go:272 +0x4a

I've tried to implement the changes you mentioned, but nothing changes.
Can you help me please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants