USB-WAKEUP-BLOCKER(1)

NAME
usb-wakeup-blocker - control which USB devices may wake the system from sleep

SYNOPSIS
usb-wakeup-blocker [OPTIONS]

DESCRIPTION
usb-wakeup-blocker disables USB remote wakeup for the devices you choose, so that a nudged mouse or a stray USB signal no longer brings the machine out of sleep. By default it blocks only mice; keyboards and every other device keep their ability to wake the system.

On Linux the tool reads and writes the power/wakeup attribute of each device under /sys/bus/usb/devices, falling back to lsusb(8) only to classify devices and to fill in missing product names. On macOS it drives an IOKit helper instead.

Applying changes requires root privileges. Read-only modes such as -l still need root to read every device attribute.

OPTIONS

-a  Block all USB devices from waking the system.

-m  Block only mice. This is the default.

-c  Block both mice and keyboards.

-w PRODUCT
    Whitelist a USB device by product name, so it keeps its ability to wake the system. May be given more than once. Use the Product field shown by -v or -l to find the right name; a partial match is enough.

-d  Dry run. Show what would change without touching any device.

-v  Verbose output, including a table of every device and its state.

-l  List the current wakeup status of all USB devices and exit without changing anything.

-p PATH
    Act on one device only, given as a sysfs path on Linux or a location ID on macOS. This is the form the udev rule uses for hot-plugged devices.

--daemon
    macOS only. Run as a persistent daemon that disables wakeup before each sleep.

-h  Show a usage summary and exit.

FILES

/etc/usb-wakeup-blocker.conf
    Options passed to the systemd service, as ARGS. Preserved across package upgrades.

/usr/lib/systemd/system/usb-wakeup-blocker.service
    One-shot unit that applies the policy at boot.

/usr/lib/udev/rules.d/99-usb-wakeup-blocker.rules
    Applies the policy to devices plugged in while the system is running.

EXAMPLES
Block mice and keyboards, but let one keyboard through:

        usb-wakeup-blocker -c -w "My Keyboard"

Block everything except a wireless receiver:

        usb-wakeup-blocker -a -w "USB Receiver"

Show the current state without changing anything:

        usb-wakeup-blocker -l

EXIT STATUS
Returns 0 on success and a non-zero value if the arguments are invalid or the device state could not be read or written.

SEE ALSO
lsusb(8), systemctl(1), udev(7)

BUGS
Report bugs at <https://github.com/nogunix/usb-wakeup-blocker/issues>.