Skip to content

Instantly share code, notes, and snippets.

@luismisanchez
Last active May 14, 2024 12:47
Show Gist options
  • Save luismisanchez/575baa20558c34434d433cbaad18650d to your computer and use it in GitHub Desktop.
Save luismisanchez/575baa20558c34434d433cbaad18650d to your computer and use it in GitHub Desktop.
Bluetooth restart after sleep/wake on Ubuntu 24.04
#!/bin/sh
# Put this on /lib/systemd/system-sleep/bt
# chmod +x /lib/systemd/system-sleep/bt
case $1 in
post)
modprobe -r btusb
sleep 1
service bluetooth restart
sleep 1
modprobe btusb
sleep 1
systemctl restart systemd-udevd systemd-udevd-kernel.socket systemd-udevd-control.socket
;;
esac
@luismisanchez
Copy link
Author

Working on Lenovo ThinkPad E16 Gen 1 (core i7). After sleep Logitech devices (MX series) were detected and apparently connected but didn't work until this fix applied. Source: https://askubuntu.com/a/1146734/1276226

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment