Multi-Planking in elementary OS

A comment on my original article, combined with a holdiay, created an opportunity for improvement.

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.

You can install the app from my PPA:

sudo apt-add-repository ppa:heathbar/multiplank
sudo apt-get update
sudo apt-get install multiplank

Once installed, enable multiplank by issuing the following command:

multiplank -e

And to disable:

multiplank -d

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.

Get the code here: https://code.launchpad.net/~heathbar/multiplank/trunk

12 thoughts on “Multi-Planking in elementary OS

  1. John

    This works brilliantly, Thanks.

  2. Lolo

    Great app man!

  3. Supersweet!

  4. Waqas

    I am running Freya 0.3.2 and get the following error on running multiplank -e. It still only shows on the primary monitor.

    ** (multiplank:3688): WARNING **: Couldn’t connect to accessibility bus: Failed to connect to socket /tmp/dbus-oCFXQnj1RH: Connection refused
    ** Message: Multiplank.vala:64: Enabling…

  5. wilcy

    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.

  6. Aeolus

    Little problem, it seems to work even after removing… (or maybe I’m doing something wrong?). What is the proper way of getting rid of this?

  7. Michał

    Well,
    I’m working on elementary 0.4 Loki and it doesn’t work as it should.
    It makes docs on both screens, but docs are really tiny.

    • Michał

      OK, pressing Ctrl and scrolling mouse helps.

  8. Hi, when I tried to use “keep in dock” feature doesn’t work, what is good place to report this? what info do you need?

    • Done, I don’t know but .config/plank was not created the .item for terminal, I created manually and reloaded the multiplank and done

  9. Ziad

    That’s simple and easy It worked so well , thanks for our Efforts !

    • Ziad

      *your

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>