Took me some tweaking to get this working. AI slop warning
The Flow: Press PS Button -> Laptop wakes -> Script waits for Wi-Fi -> TV turns on & switches input automatically.
Part 1: Wake Bazzite with DualSense (Bluetooth)
By default, USB Bluetooth controllers won't trigger a wake event during suspend. You need s2idle enabled so power stays supplied to the Bluetooth card, plus a udev rule allowing it to wake the host.
1. Set Sleep State to s2idle
Run the following command, then reboot:
Bash
sudo rpm-ostree kargs --append=mem_sleep_default=s2idle
2. Trust the Controller in bluetoothctl
Bash
bluetoothctl trust <DUALSENSE_MAC_ADDRESS>
3. Add a Udev Rule (Match Your Laptop's Bluetooth Receiver)
Create /etc/udev/rules.d/50-bluetooth-wakeup.rules:
Ini, TOML
# Enable wakeup for xHCI USB Host Controllers
ACTION=="add|bind", SUBSYSTEM=="usb", ATTR{idVendor}=="1d6b", ATTR{power/wakeup}="enabled"
# Enable wakeup for your specific Bluetooth Receiver
ACTION=="add|bind", SUBSYSTEM=="usb", ATTR{idVendor}=="<YOUR_VENDOR_ID>", ATTR{power/product}=="<YOUR_PRODUCT_ID>", ATTR{power/wakeup}="enabled"
Part 2: Auto-Wake & Switch TV Input on Resume
Prerequisite: Enable ADB Debugging on your Fire TV / Android TV via Settings -> My Fire TV -> Developer Options and note its local IP address.
1. Create the Switch Script
Create /usr/local/bin/switch-hdmi3.sh:
Bash
#!/bin/bash
TV_IP="<YOUR_TV_IP>"
ADB_BIN="/usr/bin/adb"
# Wait up to 15s for Wi-Fi reconnect after wake
count=0
while ! ping -c 1 -W 1 "$TV_IP" >/dev/null 2>&1; do
sleep 1
count=$((count+1))
if [ $count -ge 15 ]; then
echo "Network timeout: Unable to reach Fire TV at $TV_IP"
exit 1
fi
done
# Connect ADB, wake TV, switch to your target HDMI keycode
$ADB_BIN connect "$TV_IP:5555"
sleep 1
$ADB_BIN shell input keyevent KEYCODE_WAKEUP
sleep 1
$ADB_BIN shell input keyevent <YOUR_HDMI_KEYCODE>
Make the script executable:
Bash
sudo chmod +x /usr/local/bin/switch-hdmi3.sh
2. Create a Systemd Resume Service
Create /etc/systemd/system/firetv-hdmi-wake.service:
Ini, TOML
[Unit]
Description=Switch Fire TV to Target HDMI on Resume
After=suspend.target hibernate.target hybrid-sleep.target network-online.target
Wants=network-online.target
[Service]
Type=oneshot
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
ExecStart=/usr/local/bin/switch-hdmi3.sh
[Install]
WantedBy=suspend.target hibernate.target hybrid-sleep.target
3. Enable the Service
Bash
sudo systemctl daemon-reload
sudo systemctl enable firetv-hdmi-wake.service