From b7f1abf9b2c6a3fd38ad2cdc3a8ccd869bbc10c0 Mon Sep 17 00:00:00 2001 From: Haelnorr Date: Sun, 8 Jun 2025 14:22:17 +1000 Subject: [PATCH] added script to boot windows --- .local/bin/bootwindows | 14 ++++++++++++++ .local/bin/project | 8 ++++---- 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100755 .local/bin/bootwindows diff --git a/.local/bin/bootwindows b/.local/bin/bootwindows new file mode 100755 index 0000000..6e2cb4e --- /dev/null +++ b/.local/bin/bootwindows @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +win_bootnum=$(efibootmgr | grep -i "windows boot manager" | awk '{print $1}' | sed 's/Boot//;s/\*//') +if [[ -z "$win_bootnum" ]]; then + echo "Windows Boot Manager not found in UEFI boot entries." + exit 1 +fi +echo "Setting Windows Boot Manager (Boot$win_bootnum) as next boot" +sudo efibootmgr -n "$win_bootnum" +if [[ $? -ne 0 ]]; then + echo "Failed to set BootNext" + exit 1 +fi +echo "Rebooting now..." +reboot diff --git a/.local/bin/project b/.local/bin/project index 88120e7..d2f521c 100755 --- a/.local/bin/project +++ b/.local/bin/project @@ -5,9 +5,9 @@ PROJECTS_DIR="$HOME/projects" # Function to print usage print_usage() { - echo "Usage: $0 [-n] " + echo "Usage: $0 [-c] " echo "Options:" - echo " -n Create a new project directory if it does not exist" + echo " -c Create a new project directory if it does not exist" } # Check if at least one argument is provided @@ -21,9 +21,9 @@ CREATE_NEW=false PROJECT_NAME="" # Parse options -while getopts ":n" opt; do +while getopts ":c" opt; do case $opt in - n) + c) CREATE_NEW=true ;; \?)