https://wiki.archlinux.org/api.php?action=feedcontributions&user=Jjin082693&feedformat=atomArchWiki - User contributions [en]2024-03-29T09:53:56ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Newsboat&diff=353998Newsboat2014-12-29T00:52:24Z<p>Jjin082693: Newsbeuter: Automatic feed reloads: change terminology to be consistent with Newsbeuter convention</p>
<hr />
<div>[[Category:Internet applications]]<br />
From the [http://newsbeuter.org/ project web page]:<br />
:Newsbeuter is an open-source RSS/Atom feed reader for text terminals. It runs on Linux, FreeBSD, Mac OS X and other Unix-like operating systems. Newsbeuter's great configurability and vast number of features make it a perfect choice for people that need a slick and fast feed reader that can be completely controlled via keyboard.<br />
== Installation ==<br />
{{Pkg|newsbeuter}} is available from the official repositories<br />
== Usage ==<br />
Once installation is finished, newsbeuter can be started from the command line with<br />
<br />
newsbeuter<br />
<br />
Navigation is pretty straightforward. To see a complete list of keybindings consult the man page or the hit the {{ic|?}} key from inside<br />
newsbeuter. <br />
<br />
{{Warning| newsbeuter can't start without any configured feeds. To add feeds see the next section [[#Managing feeds]]}}<br />
{{Note| keybindings can be re-binded. See [[#Configuration]] and consult the man page for the list of bindable functions}}<br />
<br />
== Managing feeds ==<br />
Adding, removing, and tagging feeds is done by editing the urls file. By default that is {{ic|~/.newsbeuter/urls}}.<br />
<br />
=== Adding/Removing feeds ===<br />
To add URLs, open {{ic|~/.newsbeuter/urls}} with your favorite text editor and add the URLs, one per line:<br />
<br />
<nowiki>http://rss.cnn.com/rss/cnn_topstories.rss</nowiki><br />
<nowiki>http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml</nowiki><br />
<br />
If you need to add URLs that have restricted access via username/password, simply provide the username/password in the<br />
following way:<br />
<br />
<nowiki>http://username:password@hostname.domain.tld/feed.rss</nowiki><br />
<br />
In order to protect username and password, make sure that {{ic|~/.newsbeuter/urls}} has the appropriate permissions. <br />
<br />
Newsbeuter also makes sure that usernames and passwords within URLs aren’t displayed in its user interface. In case there is a @ in the<br />
username, you need to write it as %40 instead so that it can be distinguished from the @ that separates the username/password<br />
part from the hostname part. <br />
<br />
You can also configure local files as feeds, by prefixing the local path with {{ic|file://}} and adding it to the {{ic|~/.newsbeuter/urls}} file:<br />
<br />
file:///var/log/rss_eventlog.xml<br />
<br />
To '''remove''' a feed, simply delete the line from your urls file<br />
<br />
=== Tagging feeds ===<br />
Every feed can be assigned 0 or more tags. This makes it easy to categorize your feeds as well as the ability to easily<br />
apply commands to multiple feeds at once. <br />
<br />
Usually, the {{ic|~/.newsbeuter/urls}} file contains one RSS feed URL per line. To assign a tag to an RSS feed, <br />
simply attach it as a single word, separated by blanks such as space or tab. If the tag needs to contain <br />
spaces, you must use quotes (") around the tag (see example below). An example may <br />
look like this: <br />
<br />
<nowiki>http://blog.fefe.de/rss.xml?html interesting conspiracy news "cool stuff"</nowiki> <br />
<nowiki>http://rss.orf.at/news.xml news orf</nowiki> <br />
<nowiki>http://www.heise.de/newsticker/heise.rdf news interesting</nowiki> <br />
<br />
When you now start newsbeuter with this configuration, you can press {{ic|t}} to select a tag. When you select <br />
the tag "news", you will see all three RSS feeds. Pressing {{ic|t}} again and e.g. selecting the "conspiracy" <br />
tag, you will only see the {{ic|<nowiki>http://blog.fefe.de/rss.xml?html</nowiki>}} RSS feed. Pressing {{ic|Ctrl-T}} clears the current tag, <br />
and again shows all RSS feeds, regardless of their assigned tags.<br />
<br />
{{Note| If the tag name contains spaces, the tag must be bounded by {{ic|"}}}}<br />
==== Special tags ====<br />
===== Custom feed names =====<br />
The name of a feed can be defined with a special tag in your urls file. Simply '''prefix''' the tag name with the <br />
{{ic|~}} character and the tag name will become the feed name.<br />
<br />
For example:<br />
<br />
<nowiki>http://rss.cnn.com/rss/cnn_topstories.rss</nowiki> "~CNN Top stories"<br />
<br />
will define the feed with feed-name "CNN Top stories"<br />
<br />
===== Hidden feeds =====<br />
A feed can be '''hidden''' from the regular list of feeds by '''prefixing''' the tag name with an {{ic|!}}. <br />
<br />
For example: <br />
<br />
<nowiki>http://rss.orf.at/news.xml</nowiki> "!ORF News (hidden)" <br />
<br />
The content of a '''hidden''' feed can only be found through a query feed.<br />
<br />
== Configuration ==<br />
Several aspects of newsbeuter’s behaviour can be configured via a configuration file which is located, by default, in<br />
{{ic|~/.newsbeuter/config}}. This configuration file contains lines of the form: <br />
<br />
<config-command> <arg1> ...<br />
<br />
The configuration file can also contain comments, which start with the {{ic|#}} character and go as far<br />
as the end of line. If you need to enter a configuration argument that contains spaces, use quotes {{ic|"}}<br />
around the whole argument. It’s even possible to integrate the output of external commands into the<br />
configuration. The text between two backticks {{ic|`}} is evaluated as shell command, and its output is<br />
put on its place instead. This works like backtick evaluation in Bourne-compatible shells and allows<br />
users to use external information from the system within the configuration.<br />
<br />
=== Example config ===<br />
<br />
{{hc|~/.newsbeuter/config|2=<br />
show-keymap-hint false <br />
swap-title-and-hints false<br />
browser "/usr/bin/elinks"<br />
external-url-viewer "/usr/bin/urlview"<br />
pager internal<br />
html-renderer "/usr/bin/elinks -dump"<br />
<br />
bind-key j next<br />
bind-key k prev<br />
bind-key J next-feed<br />
bind-key K prev-feed<br />
bind-key j down article<br />
bind-key k up article<br />
bind-key J next article<br />
bind-key K prev article<br />
<br />
macro y set browser "mpv %u"; open-in-browser ; set browser "elinks %u"<br />
macro o set browser "vimprobable2 %u"; open-in-browser ; set browser "elinks %u"<br />
<br />
color background white default<br />
color listnormal white default <br />
color listfocus white blue standout<br />
color info blue default standout<br />
color listfocus_unread white blue standout<br />
color listnormal_unread white default<br />
<br />
feed-sort-order name<br />
<br />
}}<br />
<br />
{{Note|To see a complete list of configuration command, consult the man page}}<br />
<br />
== Tips ==<br />
=== Automatic feed reloads ===<br />
You can use [[cron]] or [[systemd]] to automatically reload your feeds. Just add a line in your crontab, or <br />
create a systemd service/timer unit combo that issues the following command:<br />
<br />
/usr/bin/newsbeuter -x reload<br />
<br />
Alternatively, you can set Newsbeuter to automatically reload all of your feeds at startup with the following configuration:<br />
<br />
auto-reload yes<br />
<br />
With this setting, Newsbeuter also runs periodic auto-reloads -- by default, every 60 minutes. The number of minutes between automatic reloads can be configured like so:<br />
<br />
reload-time <desired number of minutes><br />
<br />
=== Pass article URL to external command ===<br />
A clever little hack allows you to pass the url of an article to an external command. The idea is to use a macro to <br />
set the browser that newsbeuter opens the article with to the path of some other command and then<br />
change it back afterwords.<br />
<br />
For example, if you subscribe to a youtube channel and you would like to open the video with [[mpv]], do the following:<br />
<br />
macro y set browser "mpv %u"; open-in-browser ; set browser "elinks %u"<br />
<br />
{{Note| to use a macro, you must first press the {{ic|,}} key, followed by the keybind. In the example above, you would type<br />
{{ic|,}} + {{ic|y}} }}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Newsbeuter won't start ===<br />
Newsbeuter cannot start without any configured feeds! If you try to do this you will get the following error:<br />
<br />
Error: no URLs configured. Please fill the file /home/ak/.newsbeuter/urls with RSS feed URLs or import an OPML file.<br />
<br />
To add urls, see [[#Managing feeds]]<br />
<br />
If that is not the problem, then you probably have another instance of newsbeuter running. Newsbeuter issues a lock on its database so<br />
that only one instance can access it at a time. Thus, attempting to open a second instance will fail<br />
<br />
== See Also ==<br />
*[http://newsbeuter.org/ Official web site]<br />
*[http://www.newsbeuter.org/doc/newsbeuter.html/ Full documentation]<br />
*[http://blog.sanctum.geek.nz/rss-with-newsbeuter/ Arabesque: Rss with Newsbeuter]</div>Jjin082693https://wiki.archlinux.org/index.php?title=Newsboat&diff=353997Newsboat2014-12-29T00:51:03Z<p>Jjin082693: Newsbeuter: Automatic feed reloads: add explanation of built-in config options</p>
<hr />
<div>[[Category:Internet applications]]<br />
From the [http://newsbeuter.org/ project web page]:<br />
:Newsbeuter is an open-source RSS/Atom feed reader for text terminals. It runs on Linux, FreeBSD, Mac OS X and other Unix-like operating systems. Newsbeuter's great configurability and vast number of features make it a perfect choice for people that need a slick and fast feed reader that can be completely controlled via keyboard.<br />
== Installation ==<br />
{{Pkg|newsbeuter}} is available from the official repositories<br />
== Usage ==<br />
Once installation is finished, newsbeuter can be started from the command line with<br />
<br />
newsbeuter<br />
<br />
Navigation is pretty straightforward. To see a complete list of keybindings consult the man page or the hit the {{ic|?}} key from inside<br />
newsbeuter. <br />
<br />
{{Warning| newsbeuter can't start without any configured feeds. To add feeds see the next section [[#Managing feeds]]}}<br />
{{Note| keybindings can be re-binded. See [[#Configuration]] and consult the man page for the list of bindable functions}}<br />
<br />
== Managing feeds ==<br />
Adding, removing, and tagging feeds is done by editing the urls file. By default that is {{ic|~/.newsbeuter/urls}}.<br />
<br />
=== Adding/Removing feeds ===<br />
To add URLs, open {{ic|~/.newsbeuter/urls}} with your favorite text editor and add the URLs, one per line:<br />
<br />
<nowiki>http://rss.cnn.com/rss/cnn_topstories.rss</nowiki><br />
<nowiki>http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml</nowiki><br />
<br />
If you need to add URLs that have restricted access via username/password, simply provide the username/password in the<br />
following way:<br />
<br />
<nowiki>http://username:password@hostname.domain.tld/feed.rss</nowiki><br />
<br />
In order to protect username and password, make sure that {{ic|~/.newsbeuter/urls}} has the appropriate permissions. <br />
<br />
Newsbeuter also makes sure that usernames and passwords within URLs aren’t displayed in its user interface. In case there is a @ in the<br />
username, you need to write it as %40 instead so that it can be distinguished from the @ that separates the username/password<br />
part from the hostname part. <br />
<br />
You can also configure local files as feeds, by prefixing the local path with {{ic|file://}} and adding it to the {{ic|~/.newsbeuter/urls}} file:<br />
<br />
file:///var/log/rss_eventlog.xml<br />
<br />
To '''remove''' a feed, simply delete the line from your urls file<br />
<br />
=== Tagging feeds ===<br />
Every feed can be assigned 0 or more tags. This makes it easy to categorize your feeds as well as the ability to easily<br />
apply commands to multiple feeds at once. <br />
<br />
Usually, the {{ic|~/.newsbeuter/urls}} file contains one RSS feed URL per line. To assign a tag to an RSS feed, <br />
simply attach it as a single word, separated by blanks such as space or tab. If the tag needs to contain <br />
spaces, you must use quotes (") around the tag (see example below). An example may <br />
look like this: <br />
<br />
<nowiki>http://blog.fefe.de/rss.xml?html interesting conspiracy news "cool stuff"</nowiki> <br />
<nowiki>http://rss.orf.at/news.xml news orf</nowiki> <br />
<nowiki>http://www.heise.de/newsticker/heise.rdf news interesting</nowiki> <br />
<br />
When you now start newsbeuter with this configuration, you can press {{ic|t}} to select a tag. When you select <br />
the tag "news", you will see all three RSS feeds. Pressing {{ic|t}} again and e.g. selecting the "conspiracy" <br />
tag, you will only see the {{ic|<nowiki>http://blog.fefe.de/rss.xml?html</nowiki>}} RSS feed. Pressing {{ic|Ctrl-T}} clears the current tag, <br />
and again shows all RSS feeds, regardless of their assigned tags.<br />
<br />
{{Note| If the tag name contains spaces, the tag must be bounded by {{ic|"}}}}<br />
==== Special tags ====<br />
===== Custom feed names =====<br />
The name of a feed can be defined with a special tag in your urls file. Simply '''prefix''' the tag name with the <br />
{{ic|~}} character and the tag name will become the feed name.<br />
<br />
For example:<br />
<br />
<nowiki>http://rss.cnn.com/rss/cnn_topstories.rss</nowiki> "~CNN Top stories"<br />
<br />
will define the feed with feed-name "CNN Top stories"<br />
<br />
===== Hidden feeds =====<br />
A feed can be '''hidden''' from the regular list of feeds by '''prefixing''' the tag name with an {{ic|!}}. <br />
<br />
For example: <br />
<br />
<nowiki>http://rss.orf.at/news.xml</nowiki> "!ORF News (hidden)" <br />
<br />
The content of a '''hidden''' feed can only be found through a query feed.<br />
<br />
== Configuration ==<br />
Several aspects of newsbeuter’s behaviour can be configured via a configuration file which is located, by default, in<br />
{{ic|~/.newsbeuter/config}}. This configuration file contains lines of the form: <br />
<br />
<config-command> <arg1> ...<br />
<br />
The configuration file can also contain comments, which start with the {{ic|#}} character and go as far<br />
as the end of line. If you need to enter a configuration argument that contains spaces, use quotes {{ic|"}}<br />
around the whole argument. It’s even possible to integrate the output of external commands into the<br />
configuration. The text between two backticks {{ic|`}} is evaluated as shell command, and its output is<br />
put on its place instead. This works like backtick evaluation in Bourne-compatible shells and allows<br />
users to use external information from the system within the configuration.<br />
<br />
=== Example config ===<br />
<br />
{{hc|~/.newsbeuter/config|2=<br />
show-keymap-hint false <br />
swap-title-and-hints false<br />
browser "/usr/bin/elinks"<br />
external-url-viewer "/usr/bin/urlview"<br />
pager internal<br />
html-renderer "/usr/bin/elinks -dump"<br />
<br />
bind-key j next<br />
bind-key k prev<br />
bind-key J next-feed<br />
bind-key K prev-feed<br />
bind-key j down article<br />
bind-key k up article<br />
bind-key J next article<br />
bind-key K prev article<br />
<br />
macro y set browser "mpv %u"; open-in-browser ; set browser "elinks %u"<br />
macro o set browser "vimprobable2 %u"; open-in-browser ; set browser "elinks %u"<br />
<br />
color background white default<br />
color listnormal white default <br />
color listfocus white blue standout<br />
color info blue default standout<br />
color listfocus_unread white blue standout<br />
color listnormal_unread white default<br />
<br />
feed-sort-order name<br />
<br />
}}<br />
<br />
{{Note|To see a complete list of configuration command, consult the man page}}<br />
<br />
== Tips ==<br />
=== Automatic feed reloads ===<br />
You can use [[cron]] or [[systemd]] to automatically update your feeds. Just add a line in your crontab, or <br />
create a systemd service/timer unit combo that issues the following command:<br />
<br />
/usr/bin/newsbeuter -x reload<br />
<br />
Alternatively, you can set Newsbeuter to automatically update all of your feeds at startup with the following configuration:<br />
<br />
auto-reload yes<br />
<br />
With this setting, Newsbeuter also runs periodic auto-updates -- by default, every 60 minutes. The number of minutes between automatic reloads can be configured like so:<br />
<br />
reload-time <desired number of minutes><br />
<br />
=== Pass article URL to external command ===<br />
A clever little hack allows you to pass the url of an article to an external command. The idea is to use a macro to <br />
set the browser that newsbeuter opens the article with to the path of some other command and then<br />
change it back afterwords.<br />
<br />
For example, if you subscribe to a youtube channel and you would like to open the video with [[mpv]], do the following:<br />
<br />
macro y set browser "mpv %u"; open-in-browser ; set browser "elinks %u"<br />
<br />
{{Note| to use a macro, you must first press the {{ic|,}} key, followed by the keybind. In the example above, you would type<br />
{{ic|,}} + {{ic|y}} }}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Newsbeuter won't start ===<br />
Newsbeuter cannot start without any configured feeds! If you try to do this you will get the following error:<br />
<br />
Error: no URLs configured. Please fill the file /home/ak/.newsbeuter/urls with RSS feed URLs or import an OPML file.<br />
<br />
To add urls, see [[#Managing feeds]]<br />
<br />
If that is not the problem, then you probably have another instance of newsbeuter running. Newsbeuter issues a lock on its database so<br />
that only one instance can access it at a time. Thus, attempting to open a second instance will fail<br />
<br />
== See Also ==<br />
*[http://newsbeuter.org/ Official web site]<br />
*[http://www.newsbeuter.org/doc/newsbeuter.html/ Full documentation]<br />
*[http://blog.sanctum.geek.nz/rss-with-newsbeuter/ Arabesque: Rss with Newsbeuter]</div>Jjin082693https://wiki.archlinux.org/index.php?title=Bluetooth_mouse_configuration&diff=270978Bluetooth mouse configuration2013-08-13T10:28:07Z<p>Jjin082693: </p>
<hr />
<div>[[Category:Mice]]<br />
[[Category:Bluetooth]]<br />
{{Merge|Bluetooth Mouse}}<br />
<br />
== Determine your bluez dbus address ==<br />
<br />
Enter in X-window and open a terminal (dbus is usually not available outside X). Now as a '''non privileged user''' type the following command:<br />
<br />
$ dbus-send --system --type=method_call --print-reply --dest=org.bluez "/" org.bluez.Manager.ListAdapters<br />
<br />
method return sender=:1.13 -> dest=:1.16 reply_serial=2<br />
array [<br />
object path "/org/bluez/3594/hci0"<br />
]<br />
<br />
The string "/org/bluez/3594/hci0" is the name of my adapter; yours will be similar. In particular, 3594 is the PID of the bluetoothd process and varies after each computer boot, making it more difficult to create scripts targeting concrete adapters (imagine your network interface name changing on each reboot):<br />
<br />
$ pidof bluetoothd<br />
3594<br />
<br />
<br />
To easier the setup process we save the dbus name of the adapter (do not forget to put your own data here):<br />
<br />
$ export BLUEPATH="/org/bluez/3594/hci0"<br />
<br />
== Test if your PC already knows your mouse ==<br />
<br />
Issue the following command (I assume you set-up the BLUEPATH variable as explained in the previous step):<br />
<br />
$ dbus-send --system --type=method_call --print-reply --dest=org.bluez $BLUEPATH org.bluez.Adapter.GetProperties<br />
<br />
At some point in the long output, you'll see a entry reporting the known devices. In the example below there are none (empty list):<br />
<br />
dict entry(<br />
string "Devices"<br />
variant array [<br />
]<br />
)<br />
<br />
If your mouse bluetooth address were listed it could be due to several factors. For example, due to previous configuration tries maybe with other tools. But it could also be due to your mouse already knowing your PC (because you may have not followed the recomendation of making it initially forget your PC). And that wouldn't be good news: in such case, it will be a '''temporary entry''' created by bluez, just after the mouse connects (and it will be rejected due to lack of permission). These temporal entries will dissapear sooner or later removing any configuration about to be performed. This may not be a good bluez design, rather maybe one of the causes of the bluetooth unnecessary complexities for the end users. Anyway, please continue with the next step (please, do not skip it!).<br />
<br />
== Create the bluez device for the mouse ==<br />
<br />
Make sure '''your mouse is in discovery mode''' and run the following command (as always, use the dbus address of your own bluetooth adapter and, of course, replace "00:07:61:F5:5C:3D" by the bluetooth address of your own mouse):<br />
<br />
$ dbus-send --system --type=method_call --print-reply --dest=org.bluez $BLUEPATH org.bluez.Adapter.CreateDevice string:00:07:61:F5:5C:3D<br />
<br />
method return sender=:1.13 -> dest=:1.20 reply_serial=2<br />
object path "/org/bluez/3594/hci0/dev_00_07_61_F5_5C_3D"<br />
<br />
In case of the mouse not being discoverable, it will return a ''"Host is down"'' error. In case of a temporary device were already created, it will reject the command because the device already exists.<br />
<br />
{{Warning|Before discovering the trick of initially forcing the mouse to "forget" the PC, I sometimes needed to retry this command several times. Note that succeeding in this phase is the only way to be totally sure that the existing device is not temporal (bluez should have replaced any temporary device by a definitive after receiving a explicit createDevice command, but ''it doesn't''). It is also annoying that bluez requires a device to exist and be reachable in order to simply add it to the list of devices, which makes automated or manual configurations a pain (and what's more: had not been necessary to turn the mouse ON, bluez would had not become ever confused by its potential connections).<br />
}}<br />
<br />
== Test again if your PC knows your mouse ==<br />
<br />
If we repeat this command:<br />
<br />
$ dbus-send --system --type=method_call --print-reply --dest=org.bluez $BLUEPATH org.bluez.Adapter.GetProperties<br />
<br />
Now the bluetooth mouse '''bluez address''' should be listed in the known devices array (note that bluez replaces ":" by "_"):<br />
<br />
dict entry(<br />
string "Devices"<br />
variant array [<br />
object path "/org/bluez/3594/hci0/dev_00_07_61_F5_5C_3D"<br />
]<br />
)<br />
<br />
== Verify the permissions ==<br />
<br />
Issue the following command (replacing "dev_00_07_61_F5_5C_3D" by your own device address obtained in the previous step):<br />
<br />
$ dbus-send --system --type=method_call --print-reply --dest=org.bluez "$BLUEPATH/dev_00_07_61_F5_5C_3D" org.bluez.Device.GetProperties<br />
<br />
As usually, by default permissions are always denied. This is how the "Trusted" entry will likely appear:<br />
<br />
dict entry(<br />
string "Trusted"<br />
variant boolean false<br />
)<br />
<br />
== Give your mouse permission to connect your PC ==<br />
<br />
Issue the following command (with the proper replacement in the device name):<br />
<br />
$ dbus-send --system --type=method_call --print-reply --dest=org.bluez "$BLUEPATH/dev_00_07_61_F5_5C_3D" org.bluez.Device.SetProperty string:Trusted variant:boolean:true<br />
<br />
And repeat the previous step to make sure that the Trusted property is now set to "true".<br />
<br />
== Make your mouse learn your PC address ==<br />
<br />
Yes, now you must do the bad thing not recommended at the beginning of this article: connect your mouse from the PC. Make sure your mouse is discoverable with the proper button (this maybe isn't necessary, but it is an easy way to ensure that it is receiving connections instead of trying to make them) and issue the following command, using of course your own mouse bluetooth address instead of mine (as user root):<br />
<br />
root@quark:~# hidd --connect 00:07:61:F5:5C:3D<br />
<br />
Now the mouse should work in your X-window session. However, this is not our goal. The entire point of this article is to automate the mouse connection. Since your PC already knows your mouse, has authorized it and the mouse knows the PC, now it should automatically reconnect each time it is powered on.<br />
<br />
Test if this is true by powering OFF and then ON again your mouse (of course, discovery mode is no longer required). Move your mouse: after a few seconds it should connect the PC and work. Note that this may take as many as 10 or 15 seconds, because your computer may need some time to detect the connection lost and accept a new connection (if the mouse is kept enough time in OFF state, the connection after powering it ON will be nearly immediate). The automatic mouse connection will now occur also after rebooting the computer, either before or after the desktop login.<br />
<br />
= Useful tips =<br />
<br />
In case you want to use the same bluetooth mouse with several computers, you'll have to initially configure it for each computer (for example following this guide steps). Later, each time you want to switch from one computer into another, you simply need to place your mouse in discovery mode and, from the new PC, perform the connection with the hidd command as shown above. The mouse will be linked from now on to that computer.<br />
<br />
Note also that you'll need to repeat the full configuration of this guide if your bluetooth adapter changes (eg. you use a new external BT dongle adapter) since the devices creation and the permissions granted are vinculated to a particular PC bluetooth adapter (not to the computer).<br />
<br />
As a tip for XFCE users, if you change the mouse properties (acceleration, etc) select ''Save session for future logins'' before the next immediate logout (otherwise, mouse settings seem not to be saved).<br />
<br />
= Troubleshooting =<br />
<br />
When strictly following this guide, you should not need to debug your mouse connections. In case you need it, you may enable the bluetooth daemon debug. There are no startup options for this, but you may kill the '''bluetoothd''' process and manually launch it again with the '''-d''' option. This is a sample of the output (in '''/var/log/daemon.log''') reporting the typical problem: the mouse already knows the PC and connects it, the daemon creates a temporary device for the mouse, after some time with no authentication performed it rejects the mouse connection (what a pity!) and removes the temporary device:<br />
<br />
May 13 01:11:11 quark bluetoothd[3881]: adapter_get_device(00:07:61:F5:5C:3D)<br />
May 13 01:11:11 quark bluetoothd[3881]: adapter_create_device(00:07:61:F5:5C:3D)<br />
May 13 01:11:11 quark bluetoothd[3881]: Creating device /org/bluez/3881/hci0/dev_00_07_61_F5_5C_3D<br />
May 13 01:11:11 quark bluetoothd[3881]: btd_device_ref(0xb9397530): ref=1<br />
May 13 01:11:11 quark bluetoothd[3881]: Incoming connection on PSM 17<br />
May 13 01:11:24 quark bluetoothd[3881]: Removing temporary device /org/bluez/3881/hci0/dev_00_07_61_F5_5C_3D<br />
May 13 01:11:24 quark bluetoothd[3881]: Removing device /org/bluez/3881/hci0/dev_00_07_61_F5_5C_3D<br />
May 13 01:11:24 quark bluetoothd[3881]: btd_device_unref(0xb9397530): ref=0<br />
May 13 01:11:24 quark bluetoothd[3881]: device_free(0xb9397530)<br />
<br />
This is the output under a successfully accepted connection of a known and trusted mouse:<br />
<br />
Jun 4 00:56:50 quark bluetoothd[9572]: src/adapter.c:adapter_get_device() adapter_get_device(00:07:61:F5:5C:3D)<br />
Jun 4 00:56:50 quark bluetoothd[9572]: input/server.c:connect_event_cb() Incoming connection on PSM 17<br />
Jun 4 00:56:50 quark bluetoothd[9572]: input/server.c:connect_event_cb() Incoming connection on PSM 19<br />
<br />
The internal configuration is stored in '''/var/lib/bluetooth/00:0F:3D:0B:F8:6B''' (being '''XX:XX:XX...''' your PC bluetooth adapter address). Inside this directory there are files containing the devices and their permissions. Another way to configure the mouse would have been to momentarily stop the daemon and create here the proper files, but that wouldn't be portable. The good old times of plain easy configuration files in Linux are unnecessarily going away (and the new HOWTO lengths are unnecessarily growing).<br />
<br />
= More information =<br />
<br />
If you download the original source package from [http://www.bluez.org/ Bluez site] (for example bluez-4.65.tar.gz) and extract the files, the subdirectory '''test''' contains some useful python scripts. The '''test-device''' for example can be used to create devices and change the permissions (instead of using the dbus-send syntax).<br />
<br />
Here is a compilation of useful samples for common bluetooth tasks (the syntax is very tricky depending on the data type). They are very useful for scripts, all of them are tested and some are used by this guide. Remember that first you need to get your own device names (instead of the ones in these samples) as explained in the sections above:<br />
<br />
dbus-send --system --type=method_call --print-reply --dest=org.bluez "/" org.bluez.Manager.ListAdapters<br />
dbus-send --system --type=method_call --print-reply --dest=org.bluez "/org/bluez/3858/hci0" org.bluez.Adapter.GetProperties<br />
dbus-send --system --type=method_call --print-reply --dest=org.bluez "/org/bluez/3858/hci0" org.bluez.Adapter.SetProperty string:Name variant:string:"My Name"<br />
dbus-send --system --type=method_call --print-reply --dest=org.bluez "/org/bluez/3858/hci0" org.bluez.Adapter.SetProperty string:Powered variant:boolean:true<br />
dbus-send --system --type=method_call --print-reply --dest=org.bluez "/org/bluez/3858/hci0" org.bluez.Adapter.SetProperty string:Discoverable variant:boolean:true<br />
dbus-send --system --type=method_call --print-reply --dest=org.bluez "/org/bluez/3858/hci0" org.bluez.Adapter.SetProperty string:DiscoverableTimeout variant:uint32:0<br />
dbus-send --system --type=method_call --print-reply --dest=org.bluez "/org/bluez/3858/hci0" org.bluez.Adapter.SetProperty string:Pairable variant:boolean:true<br />
dbus-send --system --type=method_call --print-reply --dest=org.bluez "/org/bluez/3858/hci0" org.bluez.Adapter.SetProperty string:PairableTimeout variant:uint32:0<br />
<br />
dbus-send --system --type=method_call --print-reply --dest=org.bluez "/org/bluez/3858/hci0" org.bluez.Adapter.CreateDevice string:00:12:EE:35:7A:21<br />
dbus-send --system --type=method_call --print-reply --dest=org.bluez "/org/bluez/3858/hci0/dev_00_12_EE_35_7A_21" org.bluez.Device.GetProperties<br />
dbus-send --system --type=method_call --print-reply --dest=org.bluez "/org/bluez/3858/hci0/dev_00_12_EE_35_7A_21" org.bluez.Device.SetProperty string:Trusted variant:boolean:true<br />
dbus-send --system --type=method_call --print-reply --dest=org.bluez "/org/bluez/3858/hci0" org.bluez.Adapter.RemoveDevice objpath:"/org/bluez/3858/hci0/dev_00_12_EE_35_7A_21"<br />
<br />
=Related Articles=<br />
[[Bluetooth]]<br></div>Jjin082693