Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bin/omarchy-menu
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ show_share_menu() {
}

show_toggle_menu() {
local options="󱄄 Screensaver\n󰔎 Nightlight\n󱫖 Idle Lock\n󰂛 Notifications\n󰍜 Top Bar\n󱂬 Workspace Layout\n Window Gaps\n 1-Window Ratio\n󰍹 Monitor Scaling\n Direct Boot\n󰟵 Passwordless Sudo"
local options="󱄄 Screensaver\n󰔎 Nightlight\n󱫖 Idle Lock\n󰂛 Notifications\n󰍜 Top Bar\n󱂬 Workspace Layout\n Window Gaps\n 1-Window Ratio\n󰍹 Monitor Scaling\n Direct Boot\n󰟵 Passwordless Sudo\n󰾅 AMD xHCI Wake"

case $(menu "Toggle" "$options") in
*Screensaver*) omarchy-toggle-screensaver ;;
Expand All @@ -225,6 +225,7 @@ show_toggle_menu() {
*Scaling*) omarchy-hyprland-monitor-scaling-cycle ;;
*"Direct Boot"*) present_terminal omarchy-config-direct-boot ;;
*"Passwordless Sudo"*) present_terminal omarchy-sudo-passwordless ;;
*"AMD xHCI Wake"*) present_terminal omarchy-toggle-amd-xhci-wakeup ;;
*) back_to show_trigger_menu ;;
esac
}
Expand Down
11 changes: 11 additions & 0 deletions bin/omarchy-toggle-amd-xhci-wakeup
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# omarchy:summary=Keep AMD xHCI controllers awake to avoid the resume dead-USB bug
# omarchy:requires-sudo=true

omarchy-toggle \
--enabled-notification "󰾅 AMD xHCI wake fix enabled" \
--disabled-notification "󰾅 AMD xHCI wake fix disabled" \
amd-xhci-wakeup

source "$OMARCHY_PATH/install/config/hardware/amd/fix-xhci-resume.sh"
2 changes: 2 additions & 0 deletions install/config/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ run_logged $OMARCHY_INSTALL/config/hardware/apple/fix-t2.sh

run_logged $OMARCHY_INSTALL/config/hardware/lenovo/fix-yoga-pro7-bass-speakers.sh

run_logged $OMARCHY_INSTALL/config/hardware/amd/fix-xhci-resume.sh

run_logged $OMARCHY_INSTALL/config/hardware/fix-bcm43xx.sh
run_logged $OMARCHY_INSTALL/config/hardware/fix-surface-keyboard.sh
run_logged $OMARCHY_INSTALL/config/hardware/fix-yt6801-ethernet-adapter.sh
Expand Down
27 changes: 27 additions & 0 deletions install/config/hardware/amd/fix-xhci-resume.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Opt-in: keep AMD xHCI controllers awake to avoid the broken resume path.
# Off by default to preserve laptop power draw (see basecamp/omarchy#6671).
# Enable with: omarchy toggle amd-xhci-wakeup
RULE=/etc/udev/rules.d/99-omarchy-amd-xhci-wakeup.rules

if ! omarchy-toggle-enabled amd-xhci-wakeup; then
if [[ -f $RULE ]]; then
echo "AMD xHCI wake fix disabled. Removing rule..."
sudo rm -f "$RULE"
sudo udevadm control --reload-rules
fi
exit 0
fi

if lspci -nn | grep -qE "1022:(1587|15b6|15b7|15e0|15e1|15e5|1639|148c)"; then
echo "AMD xHCI detected (resume bug). Keeping controllers awake..."

cat <<'EOF' | sudo tee "$RULE" >/dev/null
# AMD xHCI controllers die on resume (Bugzilla 221073, Ubuntu 2158539). Keep
# them awake so the broken suspend->resume cycle never runs. Class-based match
# (PCI class 0x0c0330) covers all current and future AMD xHCI device IDs.
SUBSYSTEM=="pci", ATTR{vendor}=="0x1022", ATTR{class}=="0x0c0330", ATTR{power/control}="on", ATTR{d3cold_allowed}="0"
EOF

sudo udevadm control --reload-rules
sudo udevadm trigger --subsystem-match=pci --attr-match=vendor=0x1022
fi
4 changes: 4 additions & 0 deletions migrations/1787260348.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
echo "Opt-in: keep AMD xHCI controllers awake on resume"

# shellcheck source=install/config/hardware/amd/fix-xhci-resume.sh
source "$OMARCHY_PATH/install/config/hardware/amd/fix-xhci-resume.sh"