Quantcast
Channel: MX Linux Forum
Viewing all articles
Browse latest Browse all 5176

Software / Configuration • Re: Reboot to a particular operating system option in GUI or in .sh file?

$
0
0
I have MX 23.1, MX 19.4, and Windows 7 on my disk. Right now the bootloader asks on startup what to boot and wait for a while. The issue is that MX 23 will be my default system and 99% of the startups will involve it. Almost every Windows startup I make as a reboot from MX Linux.

In this situation, I'd like Grub to always boot MX 23.1 (with the latest available kernel) without waiting for the operating system to be selected. Instead I'd like to have some kind of applet or just .sh file in the MX 23.1 interface that performs a "reboot to Windows 7 /dev/sdb2" action - to use when necessary.

Is it possible to add somewhere in the GUI or perform such a task from the .sh file?
Yes, try this way:
First: On MX Boot Option do set the timeout to a small number
and do not enable "Save last boot choice"

Next: To Re-Boot into Windows try the below Desktop-launcher,
Save the text-content into a new text-file on Desktop
with filename "reboot-to-windows.desktop"

Code:

[Desktop Entry]# Filename: reboot-to-windows.desktop # MX Linux forum: https://forum.mxlinux.org/viewtopic.php?p=758532#p758532# fehlix : 27.12.2023Type=ApplicationName=Reboot to WindowsComment=Reboot to WindowsCategories=System;Exec=pkexec bash -c 'A=$(printf "\x27"); M=$(grep -m1 -oiP "^[[:space:]]*menuentry[^$A]+$A\Kwindows[^$A]+" /boot/grub/grub.cfg); grub-editenv - set saved_entry=0; grub-reboot "$M"; dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.Reboot boolean:true'Icon=winemineTerminal=falseStartupNotify=falseCategories=System;Path=
When you click on the Desktop-file, it may first ask to "Mark the launcher excutable",
at least that is valid for MX-23 Xfce.
Next it will ask to authenticate with your user password, b/c it needs to adjust some grub-boot related entries.
Let us know whether it works.
Thanks

Statistics: Posted by fehlix — Wed Dec 27, 2023 7:28 pm



Viewing all articles
Browse latest Browse all 5176

Trending Articles