From ccc88a011182b9e9f477e05cc5515f5d4592f278 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 20 Feb 2026 15:53:15 +0100 Subject: [PATCH] Ensure config is available so starting the service immediately will work --- bin/omarchy-toggle-hybrid-gpu | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/bin/omarchy-toggle-hybrid-gpu b/bin/omarchy-toggle-hybrid-gpu index 27a6a3ab..c2395ba8 100755 --- a/bin/omarchy-toggle-hybrid-gpu +++ b/bin/omarchy-toggle-hybrid-gpu @@ -6,10 +6,21 @@ # Ensure supergfxctl has been installed if omarchy-cmd-missing supergfxctl; then omarchy-pkg-add supergfxctl - sudo systemctl enable --now supergfxd - # Needed to deal with restoring to sleep where going through VFIO first means we don't need to reboot. - sudo sed -i "s/\"vfio_enable\": \".*\"/\"vfio_enable\": true/" /etc/supergfxd.conf + # Create config before starting service to prevent hang on first boot + sudo tee /etc/supergfxd.conf >/dev/null <<'CONF' +{ + "mode": "Hybrid", + "vfio_enable": true, + "vfio_save": false, + "always_reboot": false, + "no_logind": false, + "logout_timeout_s": 180, + "hotplug_type": "None" +} +CONF + + sudo systemctl enable --now supergfxd fi gpu_mode=$(supergfxctl -g)