LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-07-2022, 01:06 PM   #1
slackwhere
LQ Newbie
 
Registered: Jul 2018
Distribution: c'mon.... Slackware!
Posts: 25

Rep: Reputation: Disabled
Question bluetooth Xorg/xinput settings not retained across bluetooth (dis)connect events


I have a bluetooth trackball that I use with Xorg 1.20.14. Paired up using bluetoothctl with no issues. I don't like the default pointer acceleration so I adjust it via a script when my window manager starts using the following command:

xinput set-prop 'BT4.0+2.4G Mouse' 'libinput Accel Speed' -1.0

After a period of no pointer activity the trackball will go to sleep to retain battery life. When I activate the pointer again it will reconnect to the bluetooth controller and the trackball works. These events can be witnessed via dmesg:

Quote:
[ 200.382014] input: BT4.0+2.4G Mouse as /devices/virtual/misc/uhid/0005:1915:0040.000B/input/input35
[ 200.382194] input: BT4.0+2.4G Mouse Consumer Control as /devices/virtual/misc/uhid/0005:1915:0040.000B/input/input36
[ 200.382335] hid-generic 0005:1915:0040.000B: input,hidraw8: BLUETOOTH HID v0.01 Mouse [BT4.0+2.4G Mouse] on 18:cc:18:9d:31:df

[ 215.223740] fuse: init (API version 7.34)
[ 215.822315] Bluetooth: RFCOMM TTY layer initialized
[ 215.822318] Bluetooth: RFCOMM socket layer initialized
[ 215.822321] Bluetooth: RFCOMM ver 1.11
[ 3184.538774] device br0 entered promiscuous mode
[ 3201.138412] device br0 left promiscuous mode
[57162.024736] input: BT4.0+2.4G Mouse as /devices/virtual/misc/uhid/0005:1915:0040.000C/input/input37
[57162.024901] input: BT4.0+2.4G Mouse Consumer Control as /devices/virtual/misc/uhid/0005:1915:0040.000C/input/input38
[57162.025046] hid-generic 0005:1915:0040.000C: input,hidraw8: BLUETOOTH HID v0.01 Mouse [BT4.0+2.4G Mouse] on 18:cc:18:9d:31:df


My problem is that after reconnecting I need to reissue the xinput command again to set my preferred pointer acceleration.

Is there a way to detect these events and have the script automatically execute after the trackball is reconnected. I assume there's some way to register a listener for events on the bluetooth controller but I've not found any method to do this.

I know can tail and react to syslog messages but I'd prefer to avoid that.
 
Old 05-07-2022, 07:14 PM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,839

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
You can create a custom Xorg config file to match against the input device in question and set the acceleration for that device as required...
https://docs.slackware.com/slackbook:xwindow_system
https://fedoraproject.org/wiki/Input..._configuration
 
1 members found this post helpful.
Old 05-10-2022, 08:34 AM   #3
slackwhere
LQ Newbie
 
Registered: Jul 2018
Distribution: c'mon.... Slackware!
Posts: 25

Original Poster
Rep: Reputation: Disabled
That looks promising, when I get some time I'll spend more time reviewing those links.

In the meantime I used the DBus monitor (gdbus) to detected connect events from the trackball and set the speed accordingly but I think an Xorg.conf file for trackball would be a better solution.

If I get that working I'll post the solution here once I have it worked out.
 
Old 07-09-2022, 01:06 PM   #4
slackwhere
LQ Newbie
 
Registered: Jul 2018
Distribution: c'mon.... Slackware!
Posts: 25

Original Poster
Rep: Reputation: Disabled
I finally got around to looking into this and got it working via an xorg.conf file. I placed the following config block in /etc/X11/xorg.conf.d/99-local.conf.

Section "InputClass"
Identifier "Trackball"
Driver "evdev"
MatchProduct "BT4.0+2.4G|Nordic 2.4G Wireless Receiver"
Option "AccelerationProfile" "1"
Option "ConstantDeceleration" "4.0"
EndSection

This trackball has 2 interfaces, BlueTooth or USB receiver. Xorg.conf doesn't handle hot plug devices so one of the interfaces must be present when X is started. That's not a huge issue for me since I never start X without a pointing device.

Anyway, I hope someone finds this useful.
 
Old 07-09-2022, 08:49 PM   #5
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,839

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
Quote:
Originally Posted by slackwhere View Post
I finally got around to looking into this and got it working via an xorg.conf file.
Glad to read of your progress here and that this approach worked for you.
 
  


Reply

Tags
bluetooth, xinput



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] bash builtin read problem; backspace retained ? burkecabaniss Linux - Software 11 11-10-2012 11:05 AM
2 finger scroll used to work on ubuntu lucid but not now, xinput settings not working sicosi Linux - Laptop and Netbook 0 06-28-2010 09:44 AM
Thunderbird settings aren't retained Earl Parker II Linux - Software 2 04-08-2010 06:14 PM
GNOME Nautilus: tree view not retained across login hmc Linux - Software 0 01-31-2005 02:48 AM
how to ensure hdparrm settings are retained over a reboot? zero79 Debian 3 08-09-2004 04:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration