Files
kde-linux/mkosi.extra/usr/lib/auto-hide-bootloader
Nate Graham 3ab95cffdf Don't re-show the bootloader for < 5 minute sessions
This isn't necessarily evidence of instability.

Related to #471
2026-03-18 17:17:45 -06:00

26 lines
836 B
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
# SPDX-FileCopyrightText: 2025 Thomas Duckworth <tduck@filotimoproject.org>
set -eu
case "${1:-}" in
show)
/usr/bin/bootctl set-timeout ""
;;
hide)
OTHER_OS_COUNT="$(bootctl list | grep "^\s*id:" | grep -vE "kde-linux_.*\.efi|auto-efi-shell|auto-reboot-to-firmware-setup" | wc -l)"
if [ "$OTHER_OS_COUNT" -gt 0 ]; then
echo "Multiple operating systems detected, not hiding bootloader."
exit 0
fi
if [ "$(systemctl show -p Result --value kde-linux-bless-boot.service 2>/dev/null || echo "failed")" = "success" ]; then
/usr/bin/bootctl set-timeout 0
fi
;;
*)
echo "Usage: $0 {show|hide}"
exit 1
;;
esac