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

xrandr | grep " connected"

Which will give you output like this:

DVI-I-1 connected primary 2560x1440+1920+0 (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+0+350 (normal left inverted right x axis y axis)

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).

Here is my monitored processes before and after

['wingpanel', 'plank', 'slingshot-launcher --silent']
['wingpanel', 'plank', 'plank --name dock2', 'slingshot-launcher --silent']

This should work just as well for 3 docks, although I haven’t tested it.

7 thoughts on “Dual docks in elementary OS

  1. gal

    hi, in the setting file, this is what it’s says:
    #The plug-name of the monitor for the dock to show on (e.g. DVI-I-1, HDMI1, LVDS1). Leave this empty to keep on the primary monitor.
    Monitor=

    As you can see, it asks for the “plug-name” of the monitor, and not it’s number. so I have no idea what to put there.

    Any Idea what I should do?

    • Heath

      In the terminal application run the command “xrandr”. That will list all of the outputs on your video card along with some extra info.

      • Davvos11

        Or install Arandr if you don’t like using the terminal

  2. Josh

    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.

  3. ManuelReolf

    More detailed:

  4. bahfir ilyes

    for an easy way and for a full discription to how create multiple docks in plank check this video:
    https://www.youtube.com/watch?v=xNIWq4hgw78&t=14s

Leave a Reply to Heath Cancel 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>