Dual docks in elementary OS

Update: this tutorial is still valid for systems that don’t change monitors frequently, but if your system has frequent monitor changes, check out this post: https://heathpaddock.com/?p=854

When using two monitors in elementary OS the dock only shows on one monitor. I prefer to have it shown on both monitors. Here’s how it’s done:

Open the terminal and enter the following commands to create a new dock definition with the same settings as your current dock

cd ~/.config/plank
mkdir dock2
cp dock1/settings dock2/
cd dock2

If you’re interested in mirroring the icons (aka launchers) between the two docks, enter the following command

ln -s ../dock1/launchers/ dock2/launchers

If you’d rather see a different set of items in the two docks enter this command

mkdir launchers

By default, both docks will show on the primary screen and in the same position. To change this we need to modify the settings file in the dock2 folder.

Open the settings file in your favorite text editor. You should see a setting for Monitor. Most likely you will need to change this to the number 1 to run it on your second monitor. Your first monitor is monitor 0.

Update: you will need to specify the port your monitor is plugged into. To determine the port name run the following command

So my second monitor is named “HDMI-0”. Back in the text editor, add the port name to the Monitor setting like this:

Monitor=HDMI-0

There is also a setting for Position if you’d like it to be moved to one of the sides.

You can test your settings for dock2 by entering the following command into the terminal

plank --name dock2

Press Ctrl+C to stop it.
When you’re happy with your settings you need to setup cerbere to launch dock2 at startup. You can use elementary-tweaks or dconf-editor to achieve this (or if you’re really fancy, you can use gsettings).

Not suitable for laptops or virtual machines. As both can add/remove screens on the fly. Say I have a laptop that I implemented this in for my extended monitor. As soon as I remove the extra screen, I get 2 docks on 1 screen. On top of that If I reconnect the monitor, The 2nd dock doesn’t move to the 2nd screen automatically. I believe a quick bash script could fix this issue, running it as a service.