Just a solution for Linux Based systems which are using Plank dock, to enable/disable docks when connect/disconnect external display.
Tested version= 0.11.1 (plank) on Ubuntu Gnome (16.04)
Before Using the script first follow these steps to create copy of dock for external display (Ignore if you know how to create multiple docks)
cp -Rv ~/.config/plank/dock1 ~/.config/plank/dock2
dconf-editorto change the setting for dock2 (Alternatively if you familiar with
gsettingsfrom terminal play with it.).
- keys will be under net->launchpad->plank->docks->dock2
- Change value of
monitorto whatever your external port has name (eg. mine is HDMI1, others can be VGA, VGA1,VGA2.. VGAX or HDMI,HDMI1...HDMIX, if dont know follow step 3)
Ctrlkey and right click on plank dock and then in preferences under Appearance Tab check the values in drop-down list next to On Primary Display Radio Button. Alternatively check under display settings or in
/usr/sys/class/drm/folder what card number is associated to which port id (this will be useful in script too).
- You can also play with other values like
positionkey which accepts values
How to use script:
- Save the script into
/usr/bin/and give execution permissions to it. (May require superuser or sudo permissions)
- Add the script to
Startup Applications. (Remove plank from startup if already there, however this script will kill any other instances of plank, but why to start and kill unnecassarily so remove
plankif its already in startup).
- Enjoy !!!
(I am still waiting for application menu in Plank)