dots/.bash_aliases/dualboot

16 lines
481 B
Plaintext
Raw Normal View History

2023-08-05 18:08:48 +02:00
# vim: set ft=bash :
2023-08-02 16:54:35 +02:00
reboot-to-windows ()
2023-08-02 16:50:58 +02:00
{
# Check if grub is installed by checking if the command exists, if it does
# not, then assume that the system is using systemd-boot
if grub-install --version &>/dev/null; then
windows_title=$(grep -i windows /boot/grub/grub.cfg | cut -d "'" -f 2)
sudo grub-reboot "$windows_title"
echo "Grub set to reboot to Windows"
else
sudo bootctl set-oneshot windows.conf
echo "Systemd set to reboot to Windows"
fi
}