Skip to content

This script allows Linux users with GRUB to quickly reboot into Windows without the need to manually reboot and selecting windows.

Notifications You must be signed in to change notification settings

PXDiv/Reboot-Into-Windows-Script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Reboot Into Windows Script

This script allows Linux users with GRUB as the bootloader to reboot directly into Windows with a single click. It automatically detects your Windows boot entry in GRUB and creates a desktop shortcut to reboot into Windows easily. This script works on most Linux distributions like Ubuntu, Fedora, Arch Linux, and more.

Features

  • Automatically detects Windows boot entry: The script identifies the Windows boot option in your GRUB configuration.
  • Creates a Desktop Shortcut: A .desktop file is created for easy execution via GUI. The shortcut works for GNOME, KDE, XFCE, and other major desktop environments.
  • Works on multiple Linux distributions: Compatible with Debian-based (Ubuntu), Fedora, CentOS, Arch Linux, and others.
  • No extra dependencies: Does not require any additional software outside the basic Linux environment and GRUB bootloader.

Desktop Environment Support

  • The script automatically detects your desktop environment and adjusts the .desktop file accordingly.
  • It works on GNOME, KDE, XFCE, MATE, and others. The script marks the .desktop file as trusted for GNOME-based environments (using gio set) and sets it executable for others (using chmod +x).

Requirements

  • GRUB bootloader: This script works only if GRUB is used as the bootloader. It’s compatible with most Linux distributions using GRUB.
  • Sudo privileges: The script requires root (sudo) access to modify GRUB and create system files.

Installation Instructions

  1. Download the Script Download the zip via Github (or directly via git in terminal if you know how to do so) 1

    Access the Download Location and Extract the Zip file.

    Then Navigate to the folder where the script is located

  2. Run the Script

    Go to the properties of the script to allow it to be executed 2

    Turn on "Execute as Program" 3

    Now Right Click and Run as Program 4

    5

    The script will ask for your password to make necessary system changes (like updating GRUB and creating files in /opt).

  3. After the Installation 6

    The Script will automatically place a shortcut on your desktop

    7

    Allow the Shortcut to be executed and double click the shortcut to now run it.

How the Script Works

  1. Step 1: Detect Windows GRUB Entry
    The script scans your GRUB configuration file (/boot/grub/grub.cfg or /boot/grub2/grub.cfg) for any Windows boot entries.

  2. Step 2: Create Reboot Script
    It creates a script at /opt/reboot-into-windows that tells GRUB to boot into Windows and then reboots the system.

  3. Step 3: Create Desktop Shortcut
    A .desktop file is created on the user's desktop, which can be double-clicked to reboot into Windows.

  4. Step 4: Set Permissions
    It sets up the appropriate sudo permissions to allow the script to run without entering the password every time.

Usage

  • After installation, you’ll see a new shortcut on your desktop named "Reboot into Windows".
  • To reboot into Windows, simply double-click the shortcut.
  • If prompted, enter your password for sudo access (if not set up for passwordless sudo).

Customizing the Script

You can manually adjust the script if:

  • You use a different bootloader: The script is designed for GRUB, and if you're using something else (like systemd-boot or rEFInd), you'll need to modify the script.
  • You want to change the GRUB timeout: Edit the line setting the GRUB timeout in /etc/default/grub.

Troubleshooting

  • No Windows entry found: Ensure that your GRUB configuration contains a valid Windows entry. If not, you may need to repair or update your GRUB.

  • Desktop shortcut not working: If the .desktop file doesn’t appear or doesn’t work, try marking it as executable manually:

    chmod +x /home/username/Desktop/reboot-into-windows.desktop

Contributing

Feel free to fork the repository, submit issues, and propose changes via pull requests. Your contributions are welcome!

  • Report bugs or request features through the Issues section on GitHub.
  • Provide improvements or fixes by submitting a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • This script leverages GRUB to identify the Windows boot entry. Thanks to the GRUB project for providing such an accessible way to interact with the bootloader.
  • This Script was Generated by Chat-GPT based on the instructions provided by this webpage https://rastating.github.io/creating-a-reboot-into-windows-button-in-ubuntu/ this script reduces the all the steps needed into one single simple script that handles all that.

About

This script allows Linux users with GRUB to quickly reboot into Windows without the need to manually reboot and selecting windows.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages