feat: add desktop entry for boot into windows easily (#235)

* feat: add desktop entry for boot into windows easily

* feat: add just recipe for this desktop file

---------

Co-authored-by: Juha Uotila <10782843+inffy@users.noreply.github.com>
This commit is contained in:
dreamyuki 2025-02-24 15:45:00 +07:00 committed by GitHub
parent 6a2da4d662
commit c038bb2e72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 31 additions and 1 deletions

View file

@ -77,7 +77,7 @@ sudo bootc switch --enforce-container-sigpolicy ghcr.io/ublue-os/$IMAGE_NAME:{cu
```
### Documentation
Be sure to read the [documentation](https://docs.projectbluefin.io/) for more information
Be sure to read the [documentation](https://docs.getaurora.dev/) for more information
on how to use your cloud native system.
"""
HANDWRITTEN_PLACEHOLDER = """\

View file

@ -305,3 +305,11 @@ toggle-tailscale:
fi
fi
fi
# Configure Boot to Windows desktop entry
[group('System')]
configure-boot-to-windows:
mkdir -p $HOME/.local/share/applications
cp -r /usr/share/applications/boot-to-windows.desktop $HOME/.local/share/applications
sed -i 's/Hidden=true/Hidden=false/' $HOME/.local/share/applications/boot-to-windows.desktop

View file

@ -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
kdialog --error "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

View file

@ -0,0 +1,9 @@
[Desktop Entry]
Hidden=true
Name=Boot to Windows
Comment=Boot to Windows installation
Type=Application
Terminal=false
Icon=folder-windows-symbolic
Exec=sh -c "pkexec /usr/bin/boot-to-windows"
Categories=Utility;