Ubuntu – How to hide grub unless key is pressed

bootdual-bootgrub2kubuntu

I have 2 OSs Windows 8 and Kubuntu 16.04. Kubuntu is my primary OS.
I would like my laptop to boot directly into Kubuntu, unless I press SHIFT key during boot to make Grub menu visible.
Again. I want grub menu with OSs list visible, only when I press SHIFT or any other key during boot.

I followed instructions in Hide GRUB2 menu UNLESS you hold down Shift key: how to make this happen? and it didn't work as I wanted.

I don't even want to feel that the grub is there, so the following values are required.

GRUB_HIDDEN_TIMEOUT=0.0
GRUB_TIMEOUT=0.0

Apparently linux doesn't give you the freedom it tells you it does. Because if it did /etc/grub.d/30_os-prober wouldn't change the timeout on its own.

if [ "\${timeout}" = 0 ]; then    
set timeout=10

Is there any easy way to achieve what I want? Thanks in advance.

EDIT:

It does not work.
Additionaly according to
info -f grub -n 'Simple configuration'

'GRUB_HIDDEN_TIMEOUT'
     Wait this many seconds before displaying the menu.  If <ESC> is
     pressed during that time, display the menu and wait for input
     according to 'GRUB_TIMEOUT'.  If a hotkey associated with a menu
     entry is pressed, boot the associated menu entry immediately.  If
     the timeout expires before either of these happens, display the
     menu for the number of seconds specified in 'GRUB_TIMEOUT'             before
     booting the default entry.

     If you set 'GRUB_HIDDEN_TIMEOUT', you should also set
     'GRUB_TIMEOUT=0' so that the menu is not displayed at all unless
     <ESC> is pressed.

     This option is unset by default, and is deprecated in favour of the
     less confusing 'GRUB_TIMEOUT_STYLE=countdown' or
     'GRUB_TIMEOUT_STYLE=hidden'.

I set GRUB_TIMEOUT=5 and GRUB_HIDDEN_TIMEOUT=3 and grub menu is shown for… 3 seconds!?

Clearly people behind grub, screwed it up.

Best Answer

You need to make:

GRUB_HIDDEN_TIMEOUT=5
GRUB_TIMEOUT=0 

Then, when you switch the computer on, pres ESC to enter to the boot menu, otherwise, the computer will boot in the default selection.

For sake of simplicity, you can change those values easily with Grub Customizer

sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer

In the tab General, click on advanced settings, then, select active the following keys and update the values to:

GRUB_HIDDEN_TIMEOUT = 5
GRUB_TIMEOUT = 0

Optional, to display a counter showing the remaining seconds while you can press ESC, set:

GRUB_HIDDEN_TIMEOUT_QUIET = false

GRUB settings dialog