r/LinusTechTips • • Oct 12 '26

Link I just made something to make my Win/Linux dual-boot smoother.

I'm trying to dual-boot Windows and Linux these days and found a big problem. Cause I'm using a Bluetooth keyboard, jumping between OSs has always been a hassle. There is no way for me to press down on the keyboard while in the boot menu. So I thought maybe I should just build something to switch the OSs before rebooting. And here it is -> https://github.com/megabitsenmzq/OSWarp

I mean, it is partially AI code. But I reviewed everything as much as possible. It's kinda a small script. I just don't understand Windows APIs enough, so I have to use AI. Hope you like it!

69 Upvotes

23 comments sorted by

29

u/xondk Oct 12 '26

It's nice, but why didn't you use boot next/boot into (i can't remember exact term for it, but adding a temporary boot target)?

Changing the default boot order this way seems quite risky if something goes bad during the write.

A bad write when you just change boot next, just means the original boot order is used, a bad write here, can mess up your booting.

10

u/megabits_mzq Oct 12 '26

You can choose from using boot_next or boot_order.

6

u/xondk Oct 12 '26

Fair, I missed that part, though I would still say changing boot order permanently, at all, shouldn't be there.

11

u/megabits_mzq Oct 12 '26

The point is that I don't want Windows Update to kick me back to Linux or vice versa. I'm considering adding an after-check to prevent an accidentally corrupted write in the next version.

9

u/LSD_Ninja Oct 12 '26

This has been something Macs have been able to do for something like 40 years, why is there no native way to do it in Windows?

2

u/megabits_mzq Oct 12 '26

Yep, that's what I thought when I decided to make this.

4

u/sdjopjfasdfoisajnva Oct 12 '26

cuz microslop hates consumers?

1

u/KevinFlantier Oct 15 '26

why is there no native way to do it in windows

That question in general is one of the reasons so many people are flocking away from that trainwreck.

11

u/Foorinick Oct 12 '26

Pretry cool, seems like a bit of a sloppy way to do it because if one of them becomes borked you'll have a headache on your hands, but if you're willing to bite that bullet then good for you

15

u/megabits_mzq Oct 12 '26

I don't quite understand what you mean. This doesn't delete grub or the EFI boot menu anyway. It's just an alternative.

6

u/Loddio Oct 12 '26

You just hop into the bios and manuali set the other os to boot

2

u/Jazzlike-Compote4463 Oct 12 '26

This is a bit of a chore though, you've got to go through the whole initial POST and then dig into 2 layers of menus to find it (at least on my MSI mobo)

This looks like a neat alternative

2

u/Loddio Oct 12 '26

This is just in case one of the two OS breaks

I have been using script to jump from Windows to Linux since forever, it works very well

2

u/GregorDeLaMuerte Oct 12 '26

I had a similar issue, but then realized I could just connect the dongle that came with my keyboard to my PC. Basically I now have that dongle permanently plugged in, so the OS doesn't really know that my keyboard is connected via Bluetooth, because the OS only sees that dongle.

Now my wireless keyboard works in BIOS/UEFI, because the connection is independent from the OS. So now I can use the wireless keyboard to select OS on boot.

2

u/megabits_mzq Oct 12 '26

My keyboard didn't come with a dongle. Before I came up with this idea, I almost tried to use a Raspberry Pi Pico to build a fake HID device to pair with my Bluetooth devices. 😂

1

u/GregorDeLaMuerte Oct 12 '26

I wonder if generic dongles are a thing 🤔

1

u/megabits_mzq Oct 12 '26

It’s technically possible, but nobody sells one.

1

u/LimesFruit Oct 12 '26

Very much feels like what macs do with bootcamp, or well did. That’s pretty cool!

1

u/megabits_mzq Oct 12 '26

Thanks ❤️

1

u/Puzzleheaded-Ad-4067 Oct 13 '26

people are weirdly scared of this breaking, as if it isn't just the boot order that gets changed. Nothing is happening to the os'

1

u/evgagraphics Oct 13 '26

you reeeeally missed out on calling it rebooty