I am trying to find a way that if power button boots ubuntu and another button or pressed in conjunction with the power key can boot me to windows 10 instead. Is there any way that this is possible? Need help.
1 Answer
First off you have to find the grub entries present in your system via
grep -i "menuentry '" /etc/grub/grub.cfg
For ubuntu linux , the menuentry
should look like this
Ubuntu, with Linux 5.4.0-18-generic (on /dev/sdaX)
and for Windows 10
Windows Boot Manager (on /dev/sdaX)
so in order to boot to the windows next time you reboot , you have to make a shell script like this :
#!/bin/bash
grub-reboot "Windows Boot Manager (on /dev/sdaX)"
reboot
You can save it as for example boot_win.sh
and you have to make it executable(by default new shell scripts haven't the exec
permission) via :
chmod +x /whatever/directory/it's/in/boot_win.sh
and assign a custom shortcut for it.