Thank you so much Ferux! =D> This problem with bluetooth going offline and restarting after an arbitrary timespan has been bothering me for so long! Now it seems to work thanks to your script.
It took me a while to understand what exactly to do, so here is a more elaborate explanation:
When the computer hibernate, suspends and resume linux looks in /etc/pm/sleep.d and run all files in there. Thus Ferux' script should be put in there in a file that is readable to all users:
Code:
cd /etc/pm/sleep.d
sudo touch 10_bluetooth
sudo chmod 0755 10_bluetooth
sudo kate 10_bluetooth
Now copy and paste Ferux' script into the new file:
Code:
#!/bin/bash
#Code from http://ubuntuforums.org/showthread.php?t=1387211
. /usr/lib/pm-utils/functions
case "$1" in
hibernate|suspend)
rfkill block bluetooth
;;
thaw|resume)
rfkill unblock bluetooth
;;
*)
;;
esac
exit
Hit save and you are done! No more waiting for bluetooth!
Bookmarks