From f9f0dcc7d7a44b27732bea3ffa12259c41c97ee9 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Fri, 24 Mar 2023 09:18:41 -0600 Subject: [PATCH] chore: add session script for rebooting into BIOS --- scripts/session/session-bios.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 scripts/session/session-bios.sh diff --git a/scripts/session/session-bios.sh b/scripts/session/session-bios.sh new file mode 100644 index 0000000..6f6067d --- /dev/null +++ b/scripts/session/session-bios.sh @@ -0,0 +1,20 @@ +#!/usr/bin/sh +# +# name: Enter BIOS +# icon: system-restart +# description: Reboot into BIOS +# keywords: bios uefi reboot restart + +set -eu + +is_gnome() { + command -v dbus-send >/dev/null && \ + command -v gnome-session-quit >/dev/null && \ + dbus-send --print-reply --dest=org.gnome.Shell /org/gnome/Shell org.freedesktop.DBus.Properties.Get string:org.gnome.Shell string:ShellVersion >/dev/null 2>&1 +} + +if is_gnome; then + systemctl reboot --firmware-setup +elif command -v systemctl >/dev/null; then + systemctl reboot --firmware-setup +fi