From 6dcca8d94fbebccae5d65cae03a5adc56a3aa3f4 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Fri, 10 May 2024 13:06:50 -0400 Subject: [PATCH] Detect Windows boot option for `lock.sh pick` menu --- .config/i3/lock.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.config/i3/lock.sh b/.config/i3/lock.sh index dc90f91..de863e3 100755 --- a/.config/i3/lock.sh +++ b/.config/i3/lock.sh @@ -47,7 +47,11 @@ case "$1" in systemctl poweroff ;; pick) - $0 "$(echo -e 'lock\nlogout\nsuspend\nhibernate\nreboot\nreboot to Windows\nshutdown' | rofi -dmenu -i)" + if jc efibootmgr | jq -e '.boot_options|any(.display_name == "Windows Boot Manager")' + then + extra_reboot_options="reboot to Windows\n" + fi + $0 "$(echo -e 'lock\nlogout\nsuspend\nhibernate\nreboot\n'"${extra_reboot_options}shutdown" | rofi -dmenu -i)" ;; *) echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|reboot to Windows|shutdown|pick}"