The Problem
Your ASUS ROG Flow Z13 (2025) wakes from suspend whenever you close the detachable keyboard after suspending. This is caused by the USB keyboard controller being enabled for wake-up events. When you close the magnetic keyboard, it triggers a USB activity that wakes the entire system.
This guide applies to: ASUS ROG Flow Z13 (2025) with any Linux distribution (tested on Fedora)
Root Cause
The Flow Z13's keyboard connects via USB (Bus 003) and is configured to wake the system by default. When you suspend and then close the keyboard lid, the USB controller detects this as activity and wakes the laptop immediately.
Solution: Disable Keyboard USB Bus Wake up
This fix disables wake-up specifically for the keyboard's USB bus before suspend and re-enables it after resume. It's targeted, reversible, and doesn't affect other USB devices.
Step 1: Verify Your Keyboard Bus
First, confirm your keyboard is on Bus 003:
lsusb | grep -i keyboard
You should see:
Bus 003 Device 003: ID 0b05:1a30 ASUSTek Computer, Inc. GZ302EA-Keyboard
If your keyboard shows a different bus number, replace usb3 with your bus number in the next step.
Step 2: Create the Systemd Sleep Script
Create a new file:
sudo nano /etc/systemd/system-sleep/disable-keyboard-bus-wakeup
Copy and paste this content:
#!/bin/bash
# ASUS ROG Flow Z13 (2025) - Disable keyboard USB bus wakeup during suspend
# This prevents the laptop from waking when closing the detachable keyboard
case $1 in
pre)
# Disable wakeup for Bus 003 (keyboard) before suspend
echo "usb3" | tee /proc/acpi/wakeup >/dev/null 2>&1
;;
post)
# Re-enable after resume
echo "usb3" | tee /proc/acpi/wakeup >/dev/null 2>&1
;;
esac
If your keyboard is on a different bus, replace usb3 with your bus number (e.g., usb5 if the keyboard is on Bus 005).
Step 3: Make the Script Executable
sudo chmod +x /etc/systemd/system-sleep/disable-keyboard-bus-wakeup
Step 4: Verify the Script
ls -la /etc/systemd/system-sleep/
You should see disable-keyboard-bus-wakeup in the list.
Step 5: Reboot and Test
sudo reboot
After reboot, test the fix:
- Open a terminal
- Run:
systemctl suspend -i(or close the lid using your desktop environment) - Wait for the system to fully sleep
- Close the keyboard lid (or move the keyboard) without pressing anything
- The system should remain asleep
- Press the power button to wake it (this still works because power button wake-up is separate)
Step 6: Check Suspension Status (Optional)
After the first suspend cycle, verify the fix is working:
cat /proc/acpi/wakeup | grep usb
You should see usb3 (or your keyboard bus) showing *disabled after suspending.
Verification Commands
Check which USB bus your keyboard is on
lsusb -v | grep -A 5 "1a30"
Check current wake-up status for your keyboard bus
cat /proc/acpi/wakeup | grep -E "usb3|usb4|usb5|usb6|usb7|usb8"
View the systemd sleep hook logs
journalctl -u systemd-suspend -n 20
Troubleshooting
Issue: The fix didn't work
Solution: Verify your keyboard is actually on Bus 003:
lsusb | grep -i keyboard
If it shows a different bus number (e.g., Bus 005), update the script to use that bus.
Issue: External USB devices won't wake the system
This is expected behavior. The fix disables wake-up only for the keyboard bus. External USB devices won't wake the system, which is usually the desired behavior. If you need external USB devices to wake the system, create a separate script targeting only those devices.
Issue: Power button doesn't wake the system
Power button wake-up is controlled separately and should not be affected by this fix. If it's not working, check:
cat /proc/acpi/wakeup | grep -i power
Reverting the Fix
If you want to undo this change:
sudo rm /etc/systemd/system-sleep/disable-keyboard-bus-wakeup
sudo reboot
The fix is completely reversible with no permanent changes to your system.
How It Works
When your system suspends:
- The systemd sleep hook runs the
prephase - The keyboard USB bus wake-up is disabled
- System enters suspend
- Closing the keyboard no longer triggers wake-up
- On resume, the systemd sleep hook runs the
postphase - The keyboard USB bus wake-up is re-enabled
- Everything works normally until the next suspend
Why This Fix is Better Than Disabling All USB Wake up
- Targeted: Only affects the keyboard, not external USB devices
- Minimal: Single file, easy to understand and maintain
- Reversible: Can be removed completely without any system changes
- Persistent: Survives reboots
- Safe: Doesn't disable power button or other wake up sources
Additional Notes
- This fix works for any Linux distribution on the Flow Z13 (Fedora, Ubuntu, Arch, etc.)
- The script follows systemd conventions and won't interfere with other sleep hooks
- If you have multiple USB buses you want to disable, you can add more
echolines in the script - The
>/dev/null 2>&1redirects output silently; remove it if you want to see debug output in logs
Fix Tested On
- ASUS ROG Flow Z13 (2025) Model: GZ302EA
- Keyboard: ASUSTek Computer, Inc. GZ302EA-Keyboard (USB ID: 0b05:1a30)
- Fedora Linux with systemd sleep management
Top comments (0)