Ubuntu – How to auto-hide the Ubuntu Dock using gsettings on Ubuntu 17.10 and later

autohidedockgnome-shellgsettingsubuntu-dock

In Ubuntu 17.04 with Unity I could auto-hide the launcher using this command:

dconf write "/org/compiz/profiles/unity/plugins/unityshell/launcher-hide-mode" 1

But this does not work in Ubuntu 17.10 with GNOME 3. Now the "launcher" has become the "dock" also.

Note: I can do it from the Settings menu: Settings->Dock and click the toggle button for "Auto-hide the Dock" to "On", this is fine, but I am interesting in a scripting solution using e.g., gsettings, such that this feature can be turned on automatically when I install a new Ubuntu machine.

Best Answer

Open Terminal and run

gsettings set org.gnome.shell.extensions.dash-to-dock dock-fixed false

Then run

gsettings set org.gnome.shell.extensions.dash-to-dock autohide true

Also you can toggle "intellihide" (dock dodges windows) on/off by

gsettings set org.gnome.shell.extensions.dash-to-dock intellihide true/false

and set the intellihide mode by

gsettings set org.gnome.shell.extensions.dash-to-dock intellihide-mode 'OPTION'

To get the available intellihide-mode options run

gsettings range org.gnome.shell.extensions.dash-to-dock intellihide-mode