DEV Community

Ankit Khandelwal
Ankit Khandelwal

Posted on

Fixing ASUS ROG Flow Z13 (2025) Keyboard Lid Wakeup Issue on Fedora Linux

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
Enter fullscreen mode Exit fullscreen mode

You should see:

Bus 003 Device 003: ID 0b05:1a30 ASUSTek Computer, Inc. GZ302EA-Keyboard
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Step 4: Verify the Script

ls -la /etc/systemd/system-sleep/
Enter fullscreen mode Exit fullscreen mode

You should see disable-keyboard-bus-wakeup in the list.

Step 5: Reboot and Test

sudo reboot
Enter fullscreen mode Exit fullscreen mode

After reboot, test the fix:

  1. Open a terminal
  2. Run: systemctl suspend -i (or close the lid using your desktop environment)
  3. Wait for the system to fully sleep
  4. Close the keyboard lid (or move the keyboard) without pressing anything
  5. The system should remain asleep
  6. 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
Enter fullscreen mode Exit fullscreen mode

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"
Enter fullscreen mode Exit fullscreen mode

Check current wake-up status for your keyboard bus

cat /proc/acpi/wakeup | grep -E "usb3|usb4|usb5|usb6|usb7|usb8"
Enter fullscreen mode Exit fullscreen mode

View the systemd sleep hook logs

journalctl -u systemd-suspend -n 20
Enter fullscreen mode Exit fullscreen mode

Troubleshooting

Issue: The fix didn't work

Solution: Verify your keyboard is actually on Bus 003:

lsusb | grep -i keyboard
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Reverting the Fix

If you want to undo this change:

sudo rm /etc/systemd/system-sleep/disable-keyboard-bus-wakeup
sudo reboot
Enter fullscreen mode Exit fullscreen mode

The fix is completely reversible with no permanent changes to your system.


How It Works

When your system suspends:

  1. The systemd sleep hook runs the pre phase
  2. The keyboard USB bus wake-up is disabled
  3. System enters suspend
  4. Closing the keyboard no longer triggers wake-up
  5. On resume, the systemd sleep hook runs the post phase
  6. The keyboard USB bus wake-up is re-enabled
  7. 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 echo lines in the script
  • The >/dev/null 2>&1 redirects 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)