Ubuntu18.04设置在开机时自动链接蓝牙键盘

版权声明:本文为博主原创文章,未经博主允许不得转载。更好的样式阅读体验可点击文章底部<<查看原文>> https://blog.csdn.net/huuinn/article/details/81064790

ubun# 简介
系统升级到Ubuntu18.04时,启动后蓝牙键盘不能自动连接,需要虚拟键盘登录后手动连接蓝牙键盘后,才能正常使用。如何在开机时自动链接键盘?

查找蓝牙键盘的Address地址

Settings->Bluetooth菜单中查找对应的设备,并点击。在弹出来的信息中可以找到蓝牙设备的地址

进入蓝牙操作模式

sudo bluetoothctl

设置蓝牙设备

[bluetooth]# power on
[bluetooth]# agent KeyboardOnly
[bluetooth]# pairable on
[bluetooth]# scan on

[bluetooth]# pair 01:02:03:04:05:06
[bluetooth]# trust 01:02:03:04:05:06
[bluetooth]# connect 01:02:03:04:05:06
[bluetooth]# quit

创建启动脚本/etc/init.d/keyboard

#! /bin/sh
sudo hcitool spinq
exit 0

设置开机时加载

sudo chmod +x /etc/init.d/keyboard
sudo update-rc.d keyboard defaults
sudo service keyboard start

猜你喜欢

转载自blog.csdn.net/huuinn/article/details/81064790