From bf527b266f668fb842f6b190d24193d96de75a96 Mon Sep 17 00:00:00 2001 From: wolfyreload Date: Tue, 5 Nov 2024 16:17:51 +0200 Subject: [PATCH] feat(ujust): Add setup-boot-windows-steam ujust script * Adds a ujust script for making a steam shortcut that boots into Windows on dual-boot setups * Removed spaces in ujust script --- Containerfile | 1 + system_files/desktop/shared/usr/bin/boot-windows | 13 +++++++++++++ .../usr/share/ublue-os/just/86-bazzite-windows.just | 8 ++++++++ 3 files changed, 22 insertions(+) create mode 100755 system_files/desktop/shared/usr/bin/boot-windows create mode 100644 system_files/desktop/shared/usr/share/ublue-os/just/86-bazzite-windows.just diff --git a/Containerfile b/Containerfile index 6e38443d..4313aa8a 100644 --- a/Containerfile +++ b/Containerfile @@ -676,6 +676,7 @@ RUN rm -f /etc/profile.d/toolbox.sh && \ echo "import \"/usr/share/ublue-os/just/83-bazzite-audio.just\"" >> /usr/share/ublue-os/justfile && \ echo "import \"/usr/share/ublue-os/just/84-bazzite-virt.just\"" >> /usr/share/ublue-os/justfile && \ echo "import \"/usr/share/ublue-os/just/85-bazzite-image.just\"" >> /usr/share/ublue-os/justfile && \ + echo "import \"/usr/share/ublue-os/just/86-bazzite-windows.just\"" >> /usr/share/ublue-os/justfile && \ echo "import \"/usr/share/ublue-os/just/90-bazzite-de.just\"" >> /usr/share/ublue-os/justfile && \ if grep -q "kinoite" <<< "${BASE_IMAGE_NAME}"; then \ mkdir -p "/usr/share/ublue-os/dconfs/desktop-kinoite/" && \ diff --git a/system_files/desktop/shared/usr/bin/boot-windows b/system_files/desktop/shared/usr/bin/boot-windows new file mode 100755 index 00000000..1c0b994b --- /dev/null +++ b/system_files/desktop/shared/usr/bin/boot-windows @@ -0,0 +1,13 @@ +#!/usr/bin/bash + +# Look up the boot number for Windows in the EFI records +boot_number=$(echo $(efibootmgr) | grep -Po "(?<=Boot)\S{4}(?=( |\* )Windows)") + +# Check that Windows EFI entry was found +if [ -z "$boot_number" ]; then + echo "Cannot find Windows boot in EFI, exiting" + exit 1 +fi + +# Set next boot to be Windows and reboot the machine +sudo efibootmgr -n "${boot_number}" && reboot diff --git a/system_files/desktop/shared/usr/share/ublue-os/just/86-bazzite-windows.just b/system_files/desktop/shared/usr/share/ublue-os/just/86-bazzite-windows.just new file mode 100644 index 00000000..ab14b027 --- /dev/null +++ b/system_files/desktop/shared/usr/share/ublue-os/just/86-bazzite-windows.just @@ -0,0 +1,8 @@ +# vim: set ft=make : + +# Adds a script in Steam to boot Windows which is useful for dual-boot setups +setup-boot-windows-steam: + echo "Making efibootmgr -n usable without sudo password" + echo "%wheel ALL=(root) NOPASSWD: /usr/sbin/efibootmgr" | sudo tee /etc/sudoers.d/efibootmgr-config + echo "Adding /usr/bin/boot-windows as a Non-steam game" + /usr/bin/steamos-add-to-steam /usr/bin/boot-windows