Add os/arch/apple-keyboard-bt
This commit is contained in:
parent
2f93e4d44e
commit
fdd36d3a2e
20
os/arch/apple-keyboard-bt/README.md
Normal file
20
os/arch/apple-keyboard-bt/README.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Apple Keyboard auto connecting service
|
||||
|
||||
The btkbd service auto-connects the wireless Apple Keyboard to Arch Linux.
|
||||
|
||||
The keyboard must be paired and trusted before the btkbd service will work:
|
||||
|
||||
```
|
||||
$ bluetoothctl -a
|
||||
[bluetooth]# power on
|
||||
[bluetooth]# agent KeyboardOnly
|
||||
[bluetooth]# default-agent
|
||||
[bluetooth]# pairable on
|
||||
[bluetooth]# scan on
|
||||
[bluetooth]# pair <MAC ADDRESS OF KBD>
|
||||
[bluetooth]# trust <MAC ADDRESS OF KBD>
|
||||
[bluetooth]# connect <MAC ADDRESS OF KBD>
|
||||
[bluetooth]# quit
|
||||
```
|
||||
|
||||
Then run `./install` to set up the service.
|
3
os/arch/apple-keyboard-bt/btkbd.conf
Normal file
3
os/arch/apple-keyboard-bt/btkbd.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Config file for btkbd.service
|
||||
BTKBDMAC = ''00:25:BC:FA:22:C0''
|
||||
HCIDEVICE = 'hci0'
|
19
os/arch/apple-keyboard-bt/btkbd.service
Normal file
19
os/arch/apple-keyboard-bt/btkbd.service
Normal file
|
@ -0,0 +1,19 @@
|
|||
[Unit]
|
||||
Description=systemd Unit to automatically start a Bluetooth keyboard
|
||||
Documentation=https://wiki.archlinux.org/index.php/Bluetooth_Keyboard
|
||||
Requires=dbus-org.bluez.service
|
||||
After=dbus-bluez.org.service
|
||||
ConditionPathExists=/etc/btkbd.conf
|
||||
ConditionPathExists=/usr/bin/hcitool
|
||||
ConditionPathExists=/usr/bin/hciconfig
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/btkbd.conf
|
||||
ExecStart=
|
||||
ExecStart=/usr/bin/hciconfig ${HCIDEVICE} up
|
||||
# ignore errors on connect, spurious problems with bt? so start next command with -
|
||||
ExecStart=-/usr/bin/hcitool cc ${BTKBDMAC}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
12
os/arch/apple-keyboard-bt/install
Executable file
12
os/arch/apple-keyboard-bt/install
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Bluetooth
|
||||
sudo ln -s $PWD/services/btkbd.conf /etc/
|
||||
sudo ln -s $PWD/services/btkbd.service /etc/systemd/system/
|
||||
|
||||
# Install service
|
||||
sudo systemctl enable btkbd.service
|
||||
sudo systemctl start btkbd.service
|
||||
|
||||
# Turn off FN mode
|
||||
bash -c 'echo 2 > /sys/module/hid_apple/parameters/fnmode'
|
Loading…
Reference in a new issue