# Using Ubuntu as a workstation

## Enabling system wake-up from USB device

Run the following to get a list of your USB devices:

```bash
lsusb
```

The output should look like:

```
# ... more ...
Bus 004 Device 003: ID 05e3:0626 Genesys Logic, Inc. USB3.1 Hub
Bus 001 Device 002: ID 1d6b:0003 Linux Foundation 3.0 root hub
# ... more ...
```

In the above output, the hex numbers represent the vendor ID followed by the product ID, eg. `05e3` is the vendor ID (`idVendor`) for Genesys Logic and `0626` is the product ID (`idProduct`).

The files that store configurations for the above can be found at `/sys/bus/usb/devices`. To identify which directory in there contains the desired USB device (you will need to run these as `root`):

```bash
cd /sys/bus/usb/devices;
ls -1 \
  | grep -v '\:' \
  | xargs -I@ sh -c 'printf -- "@ == " && printf -- "$(cat @/idVendor):" && printf -- "$(cat @/idProduct)\n"'
```

The output should look like (intentionally matched with the `lsusb` output):

```
# ... more ...
4-1 == 05e3:0626
usb4 == 1d6b:0003
# ... more ...
```

Match the above output from `lsusb` with the most recent output and note the left value (eg. `4-1` refers to the Genesys Logic device)

Run the following to enable wake-up from the USB device:

```bash
echo enabled > /sys/bus/usb/devices/4-1/power/wakeup;
```

To enable persistence, put the above script in your `/etc/rc.local` as well.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.joeir.net/system-administration/using-ubuntu-as-a-workstation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
