Bound the hybrid GPU gate's supergfxctl query (#6799)
omarchy-hw-hybrid-gpu gates the Hybrid GPU menu entry, and it queried supergfxctl unbounded — a wedged supergfxd stalled menu rendering forever. Bound the query with the same TERM-then-KILL escalation the toggle uses, and treat a daemon that cannot answer like a machine without supergfxctl: fall back to counting GPUs rather than hiding hardware that is really there. An ordinary supergfxctl failure still hides the entry. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
090574e3a1
commit
78d3224846
@@ -2,8 +2,23 @@
|
||||
|
||||
# omarchy:summary=Detect whether the system has an active hybrid GPU configuration
|
||||
|
||||
if omarchy-cmd-present supergfxctl; then
|
||||
supergfxctl -s 2>/dev/null | grep -qw Hybrid
|
||||
else
|
||||
multiple_gpus() {
|
||||
(($(lspci | grep -cE 'VGA|3D|Display') >= 2))
|
||||
}
|
||||
|
||||
if omarchy-cmd-present supergfxctl; then
|
||||
# A wedged supergfxd blocks its clients forever, and this gate runs while
|
||||
# the menu renders. Bound the query, and treat a daemon that cannot answer
|
||||
# like a machine without supergfxctl: count GPUs instead of hiding hardware
|
||||
# that is really there.
|
||||
modes=$(timeout --kill-after=1s 1s supergfxctl -s 2>/dev/null)
|
||||
status=$?
|
||||
|
||||
if ((status == 124 || status == 137)); then
|
||||
multiple_gpus
|
||||
else
|
||||
grep -qw Hybrid <<<"$modes"
|
||||
fi
|
||||
else
|
||||
multiple_gpus
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user