maggioni.xyz/_site/feed.xml

97 lines
8.1 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Ramblings of an archer archer</title>
<description>Things which an Arch Linux user that also owns an recurve bow can write.
</description>
<link>http://praticamentetilde.github.io/</link>
<atom:link href="http://praticamentetilde.github.io/feed.xml" rel="self" type="application/rss+xml"/>
<pubDate>Thu, 07 Jul 2016 21:01:32 +0200</pubDate>
<lastBuildDate>Thu, 07 Jul 2016 21:01:32 +0200</lastBuildDate>
<generator>Jekyll v3.1.6</generator>
<item>
<title>Get a Bluetooth keyboard work with Arch Linux</title>
<description>&lt;p&gt;Ive recently got a Rapoo E6100. This is a minimal and space saving Bluetooth 3.0 keyboard. If you pair it with Windows 10, it will remain paired after reboot, giving the possibility to use it since the login screen. After installing the Bluetooth stack on my Arch via the &lt;code class=&quot;highlighter-rouge&quot;&gt;bluez&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;bluez-utils&lt;/code&gt; packages I thought the pairing process would be as simple as Windows if I used the KDE GUI menus for Bluetooth management. Thats not true. The keyboard, once paired, will reconnect automatically just after &lt;code class=&quot;highlighter-rouge&quot;&gt;plasmashell&lt;/code&gt; loaded, leaving me without keyboard during the SDDM login screen and, of course, during a non-graphical session.&lt;/p&gt;
&lt;p&gt;As usual, ive searched help in the ArchWiki, founding &lt;a href=&quot;https://wiki.archlinux.org/index.php/Bluetooth_keyboard&quot;&gt;this&lt;/a&gt; article. With that, ive succesfully reconnected my Bluetooth keyboard using the &lt;code class=&quot;highlighter-rouge&quot;&gt;bluetoothctl&lt;/code&gt; utility. The next step was configuring the service for auto connection during boot. Ive created the &lt;code class=&quot;highlighter-rouge&quot;&gt;btkbd.conf&lt;/code&gt; and the &lt;code class=&quot;highlighter-rouge&quot;&gt;btkbd.service&lt;/code&gt; files, enabling the last one with systemd. Lets give a look to the service file:&lt;/p&gt;
&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;table style=&quot;border-spacing: 0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot; style=&quot;text-align: right&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Unit]
&lt;span class=&quot;nv&quot;&gt;Description&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;systemd Unit to automatically start a Bluetooth keyboard
&lt;span class=&quot;nv&quot;&gt;Documentation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;https://wiki.archlinux.org/index.php/Bluetooth_Keyboard
&lt;span class=&quot;nv&quot;&gt;Requires&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;dbus-org.bluez.service
&lt;span class=&quot;nv&quot;&gt;After&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;dbus-org.bluez.service
&lt;span class=&quot;nv&quot;&gt;ConditionPathExists&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/etc/btkbd.conf
&lt;span class=&quot;nv&quot;&gt;ConditionPathExists&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/bin/hcitool
&lt;span class=&quot;nv&quot;&gt;ConditionPathExists&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/bin/hciconfig
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Service]
&lt;span class=&quot;nv&quot;&gt;Type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;oneshot
&lt;span class=&quot;nv&quot;&gt;EnvironmentFile&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/etc/btkbd.conf
&lt;span class=&quot;nv&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/bin/hciconfig &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;HCIDEVICE&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; up
&lt;span class=&quot;c&quot;&gt;# ignore errors on connect, spurious problems with bt?&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# so start next command with -&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;-/usr/bin/hcitool cc &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;BTKBDMAC&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Install]
&lt;span class=&quot;nv&quot;&gt;WantedBy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;multi-user.target&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;Line 13 enables the Bluetooth dongle, and line 16 connects it to the keyboard we gave the mac address in &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/btkbd.conf&lt;/code&gt;. This should work flawlessly, right? Of course it doesnt. The service starts before the &lt;code class=&quot;highlighter-rouge&quot;&gt;dbus-org.bluez.service&lt;/code&gt; is loaded and fails. However, if the service is started manually after login the Bluetooth keyboard works. After hours of trying figuring out what was wrong Ive almost asked for a return on Amazon! The last attempt I made was with sddm disabled and involved built from scratch service:&lt;/p&gt;
&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;table style=&quot;border-spacing: 0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot; style=&quot;text-align: right&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Unit]
&lt;span class=&quot;nv&quot;&gt;Description&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;systemd Unit to automatically start a Bluetooth keyboard
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Service]
&lt;span class=&quot;nv&quot;&gt;Type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;oneshot
&lt;span class=&quot;nv&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/bin/hciconfig hci0 up
&lt;span class=&quot;nv&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/bin/hcitool cc 00:11:22:33:44:55
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Install]
&lt;span class=&quot;nv&quot;&gt;WantedBy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;bluetooth.target&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;This incredibly worked. I think the problem was that &lt;code class=&quot;highlighter-rouge&quot;&gt;multi-user.target&lt;/code&gt; that needs to be reached earlier than &lt;code class=&quot;highlighter-rouge&quot;&gt;bluetooth.target&lt;/code&gt;. I got rid of all the tidiness of the ArchWiki solution just to be sure that was not the problem, but I think you can use all of that just correcting &lt;code class=&quot;highlighter-rouge&quot;&gt;WantedBy=&lt;/code&gt;. Currently I havent an ArchWiki account nor a forum one, but as soon as Ill register Ill correct the article.&lt;/p&gt;
&lt;p&gt;Let me know in the comments if this solution is well made or if its just a bodge.
Last thing: I discovered that my Bluetooth dongle is CSR 8510 A10 based so expect some ramblings about &lt;a href=&quot;http://www.0xf8.org/2014/02/the-crux-of-finding-a-hid-proxy-capable-usb-bluetooth-adapter/&quot;&gt;hid proxy&lt;/a&gt;.&lt;/p&gt;
</description>
<pubDate>Thu, 07 Jul 2016 14:49:18 +0200</pubDate>
<link>http://praticamentetilde.github.io/linux/2016/07/07/get-a-bluetooth-keyboard-work-with-arch.html</link>
<guid isPermaLink="true">http://praticamentetilde.github.io/linux/2016/07/07/get-a-bluetooth-keyboard-work-with-arch.html</guid>
<category>linux</category>
</item>
</channel>
</rss>