Recently I purchased logitech bluetooth mouse. It's lagging on ubuntu 20.04 and I found solution here. Unfortunately this solution suggests run it manually. I tried systemd and crontab to automatically run it. But no success. Can you tell me how to run this script or update bluetooth configuration?

Here is script I needed to run

sed -i -E "s/^(MinInterval=.+)$/MinInterval=6/;s/^(MaxInterval=.+)$/MaxInterval=7/;s/^(Latency=.+)$/Latency=0/;s/^(Timeout=.+)$/Timeout=2160/" /var/lib/bluetooth/device_address/mouse_address/info
sudo service bluetooth restart

1 Answer 1


If you want to run scripts on login, you can insert the script in ~/.profile or ~/.xprofile file.

edit: Didn't notice sudo. My bad.

You could add this script to root-user crontab with @reboot annotation.

install a cronjob client if you have not yet eg. cronie

sudo crontab -e to edit root users cronjobs

insert @reboot [path to script] to a new line

source: https://www.maketecheasier.com/run-bash-script-as-root-during-startup-linux/

  • But the file I wanted to edit is only root accessible.
    – hurelhuyag
    Jan 13, 2021 at 6:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.