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
This works brilliantly, Thanks.
Great app man!
Supersweet!
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…
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.
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?
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.
OK, pressing Ctrl and scrolling mouse helps.
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
That’s simple and easy It worked so well , thanks for our Efforts !
*your
Is there any way to make it show windows only on current screen? I.e dock on main screen shows/activates only those apps whose windows are on that screen ?
found it myself: dconf-editor and go to: net>launchpad>plank>docs and mark for each dock “current-workspace-only”.
I am unable to install multiplank because of following error
abhinav@abhinav:~$ sudo apt update
[sudo] password for abhinav:
Hit:2 http://archive.canonical.com/ubuntu bionic InRelease
Hit:3 http://ppa.launchpad.net/elementary-os/stable/ubuntu bionic InRelease
Hit:4 http://packages.elementary.io/appcenter bionic InRelease
Hit:5 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Ign:7 http://ppa.launchpad.net/heathbar/multiplank/ubuntu bionic InRelease
Hit:8 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:9 http://archive.ubuntu.com/ubuntu bionic-security InRelease
Hit:10 http://ppa.launchpad.net/elementary-os/os-patches/ubuntu bionic InRelease
Ign:1 https://dl.bintray.com/etcher/debian stable InRelease
Hit:12 http://ppa.launchpad.net/philip.scott/elementary-tweaks/ubuntu bionic InRelease
Get:11 https://dl.bintray.com/etcher/debian stable Release [3,674 B]
Err:14 http://ppa.launchpad.net/heathbar/multiplank/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/heathbar/multiplank/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
I tried few solutions from googling the problem but so still multiplank package is not found using apt on terminal or synaptic package manager.. Any solutions.
same result for me on latest elementary OS update from today
Still doesn’t work for elementary OS. I switched the apt repo entry to xenial but then it complains about not met dependencies. Had to use the manual approach from the linked post for now.