Switch to an earlier recovery for the internal monitor on reboot

This commit is contained in:
David Heinemeier Hansson
2026-04-23 11:54:11 +02:00
parent 3c8d7bb5ce
commit a74afeb4e5
6 changed files with 33 additions and 1 deletions
+1
View File
@@ -10,6 +10,7 @@ if [[ -f $FIRST_RUN_MODE ]]; then
rm -f "$FIRST_RUN_MODE"
bash "$OMARCHY_PATH/install/first-run/battery-monitor.sh"
bash "$OMARCHY_PATH/install/first-run/recover-internal-monitor.sh"
bash "$OMARCHY_PATH/install/first-run/cleanup-reboot-sudoers.sh"
bash "$OMARCHY_PATH/install/first-run/firewall.sh"
bash "$OMARCHY_PATH/install/first-run/dns-resolver.sh"
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
# Clear the internal-monitor-disable toggle if no external display is connected.
# Runs before the graphical session so Hyprland doesn't block on having no output
# to render to when the user rebooted with the external unplugged.
TOGGLE="$HOME/.local/state/omarchy/toggles/hypr/internal-monitor-disable.conf"
if [[ -f $TOGGLE ]] && ! omarchy-hw-external-monitors; then
rm -f "$TOGGLE"
fi
@@ -0,0 +1,11 @@
[Unit]
Description=Recover the internal monitor toggle when no external display is connected
Before=graphical-session-pre.target
ConditionPathExists=%h/.local/state/omarchy/toggles/hypr/internal-monitor-disable.conf
[Service]
Type=oneshot
ExecStart=%h/.local/share/omarchy/bin/omarchy-hw-recover-internal-monitor
[Install]
WantedBy=graphical-session-pre.target
-1
View File
@@ -7,7 +7,6 @@ exec-once = uwsm-app -- swayosd-server
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec-once = omarchy-cmd-first-run
exec-once = omarchy-powerprofiles-init
exec-once = omarchy-hyprland-monitor-internal recover
exec-once = uwsm-app -- omarchy-hyprland-monitor-watch
# Slow app launch fix -- set systemd vars
@@ -0,0 +1 @@
systemctl --user enable omarchy-recover-internal-monitor.service
+9
View File
@@ -0,0 +1,9 @@
echo "Recover the internal monitor at login when no external display is connected"
SERVICE=omarchy-recover-internal-monitor.service
mkdir -p ~/.config/systemd/user
cp $OMARCHY_PATH/config/systemd/user/$SERVICE ~/.config/systemd/user/$SERVICE
systemctl --user daemon-reload
systemctl --user enable $SERVICE