Multi-Planking in elementary OS

While my previous post provided a method to manually specify 2+ docks, this was not ideal for situations where the number of monitors frequently changes. With that in mind I created a small app that automatically starts a new instance of plank for each monitor. It dynamically adds/removes planks as you add/remove monitors.

It’s worth noting that this app does not modify or replace plank. It simply configures and starts a new instance of plank for each of the monitors connected to your system.

I opted to create a full-blown compiled app (instead of an arguably simpler shell script) because I wanted an efficient solution. I did not want to have a script running that was wasting cycles by constantly counting the monitors. With this approach, I’m able to register with the OS to be notified whenever the number of monitors changes. Then, I can effectively have the app go to sleep until a monitor change occurs. At that time, the OS wakes up multiplank which re-configures all of the planks and promptly goes back to sleep. If you have a brilliant idea on how to use inotify in a bash script to watch some file and make all of this magic happen, please comment below.

Thnx! works like a charm.
I only had to fiddle a bit with the display layout (using different sizes monitors) in order to get both planks to show up. In my case setting the non-primary monitor bottom about a px lower than the bottom of the primary did the trick.