mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Move to a hardware check for external monitors instead to deal with recover timing
This commit is contained in:
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Returns true when an external monitor is physically connected.
|
||||
# Uses kernel DRM state so the result is independent of Hyprland's startup timing.
|
||||
|
||||
for status in /sys/class/drm/card*-*/status; do
|
||||
[[ "$status" == *-eDP-*/status ]] && continue
|
||||
[[ "$(<"$status")" == "connected" ]] && exit 0
|
||||
done
|
||||
exit 1
|
||||
@@ -9,7 +9,7 @@ enable() {
|
||||
}
|
||||
|
||||
disable() {
|
||||
if omarchy-hyprland-monitors-many; then
|
||||
if omarchy-hw-external-monitors; then
|
||||
if omarchy-hyprland-toggle-disabled "$TOGGLE"; then
|
||||
omarchy-hyprland-toggle --enabled-notification " Laptop display disabled" "$TOGGLE"
|
||||
fi
|
||||
@@ -20,7 +20,7 @@ disable() {
|
||||
}
|
||||
|
||||
recover() {
|
||||
if omarchy-hyprland-monitors-none && omarchy-hyprland-toggle-enabled "$TOGGLE"; then
|
||||
if ! omarchy-hw-external-monitors && omarchy-hyprland-toggle-enabled "$TOGGLE"; then
|
||||
omarchy-hyprland-toggle "$TOGGLE"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Returns true when there are multiple monitors connected (so we can disable the internal one)
|
||||
|
||||
(( $(hyprctl monitors -j 2>/dev/null | jq length) > 1 ))
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Returns true when no real monitors are connected (ignoring Hyprland's HEADLESS fallback)
|
||||
|
||||
(( $(hyprctl monitors -j 2>/dev/null | jq '[.[] | select(.name | startswith("HEADLESS") | not)] | length') == 0 ))
|
||||
Reference in New Issue
Block a user