Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] Looking for command line access to mate-control-center settings

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
User avatar
gurfle
Posts: 385
Joined: 2009-06-04 02:08
Location: Seattle, Washington, US

[Solved] Looking for command line access to mate-control-center settings

#1 Post by gurfle »

I am looking for a good command line tool to access the settings used by mate-control-center, at least those for the mouse/touchpad dialog box.

xinput (at least with my understanding of it) does not work very well for the following reasons:

Mouse "handedness" settings:

The map button sequence in xinput get/set-button-map is unrelated to the settings in System -> Control Center -> Mouse -> Mouse dialog box: Changes in one do not affect the other, so it is impossible to write a robust command line script for setting the mouse right or left handed with xinput, because if the Control Center Mouse dialog box is set to the default "Right-handed" you must use

Code: Select all

xinput -set-button-map 3 2 1
to make it left-handed, but if the Control Center Mouse dialog box is set to "Left-handed" you must use

Code: Select all

xinput -set-button-map 1 2 3
No matter what the mouse "handedness" setting in the Control Center, xinput returns 1 2 3 as the sequence of the first three mouse buttons.

Touchpad:

When "Enable touchpad" is un-checked in System -> Control Center -> Mouse -> Touchpad, it seems impossible to enable it again with "xinput set-prop 186":

Code: Select all

nick@nickspanasonic:~$ xinput set-prop 15 186 1
nick@nickspanasonic:~$ xinput list-props 15
Device 'SynPS/2 Synaptics TouchPad':
	Device Enabled (186):	0
	Coordinate Transformation Matrix (188):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	libinput Tapping Enabled (345):	1
	libinput Tapping Enabled Default (346):	0
	libinput Tapping Drag Enabled (347):	1
	libinput Tapping Drag Enabled Default (348):	1
	libinput Tapping Drag Lock Enabled (349):	0
	libinput Tapping Drag Lock Enabled Default (350):	0
	libinput Tapping Button Mapping Enabled (351):	1, 0
	libinput Tapping Button Mapping Default (352):	1, 0
	libinput Natural Scrolling Enabled (322):	0
	libinput Natural Scrolling Enabled Default (323):	0
	libinput Disable While Typing Enabled (353):	1
	libinput Disable While Typing Enabled Default (354):	1
	libinput Scroll Methods Available (324):	1, 1, 0
	libinput Scroll Method Enabled (325):	1, 0, 0
	libinput Scroll Method Enabled Default (326):	1, 0, 0
	libinput Accel Speed (333):	0.000000
	libinput Accel Speed Default (334):	0.000000
	libinput Accel Profiles Available (335):	1, 1
	libinput Accel Profile Enabled (336):	1, 0
	libinput Accel Profile Enabled Default (337):	1, 0
	libinput Left Handed Enabled (338):	0
	libinput Left Handed Enabled Default (339):	0
	libinput Send Events Modes Available (307):	1, 1
	libinput Send Events Mode Enabled (308):	0, 0
	libinput Send Events Mode Enabled Default (309):	0, 0
	Device Node (310):	"/dev/input/event4"
	Device Product ID (311):	2, 7
	libinput Drag Lock Buttons (340):	<no items>
	libinput Horizontal Scroll Enabled (341):	0
	libinput Scrolling Pixel Distance (342):	15
	libinput Scrolling Pixel Distance Default (343):	15
	libinput High Resolution Wheel Scroll Enabled (344):	1
nick@nickspanasonic:~$ 
But as long as "Enable touchpad" is checked "xinput set-prop" works as expected:

Code: Select all

nick@nickspanasonic:~$ xinput set-prop 15 186 1
nick@nickspanasonic:~$ xinput list-props 15
Device 'SynPS/2 Synaptics TouchPad':
	Device Enabled (186):	1
	Coordinate Transformation Matrix (188):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	libinput Tapping Enabled (345):	1
	libinput Tapping Enabled Default (346):	0
	libinput Tapping Drag Enabled (347):	1
	libinput Tapping Drag Enabled Default (348):	1
	libinput Tapping Drag Lock Enabled (349):	0
	libinput Tapping Drag Lock Enabled Default (350):	0
	libinput Tapping Button Mapping Enabled (351):	1, 0
	libinput Tapping Button Mapping Default (352):	1, 0
	libinput Natural Scrolling Enabled (322):	0
	libinput Natural Scrolling Enabled Default (323):	0
	libinput Disable While Typing Enabled (353):	1
	libinput Disable While Typing Enabled Default (354):	1
	libinput Scroll Methods Available (324):	1, 1, 0
	libinput Scroll Method Enabled (325):	1, 0, 0
	libinput Scroll Method Enabled Default (326):	1, 0, 0
	libinput Accel Speed (333):	0.000000
	libinput Accel Speed Default (334):	0.000000
	libinput Accel Profiles Available (335):	1, 1
	libinput Accel Profile Enabled (336):	1, 0
	libinput Accel Profile Enabled Default (337):	1, 0
	libinput Left Handed Enabled (338):	0
	libinput Left Handed Enabled Default (339):	0
	libinput Send Events Modes Available (307):	1, 1
	libinput Send Events Mode Enabled (308):	0, 0
	libinput Send Events Mode Enabled Default (309):	0, 0
	Device Node (310):	"/dev/input/event4"
	Device Product ID (311):	2, 7
	libinput Drag Lock Buttons (340):	<no items>
	libinput Horizontal Scroll Enabled (341):	0
	libinput Scrolling Pixel Distance (342):	15
	libinput Scrolling Pixel Distance Default (343):	15
	libinput High Resolution Wheel Scroll Enabled (344):	1
nick@nickspanasonic:~$ 
This makes xinput rather frustrating to use in a reliable way from the Mate desktop, so if anyone can suggest a better command line tool to more dependably control mouse an touchpad from the command line, it would be very helpful.
Last edited by gurfle on 2024-04-09 00:01, edited 1 time in total.

User avatar
mrnordio2
Posts: 27
Joined: 2023-03-29 14:53
Has thanked: 1 time
Been thanked: 6 times

Re: Looking for command line access to mate-control-center settings

#2 Post by mrnordio2 »

Hey Gurfle,

It sounds like you're trying to manage the MATE desktop environment's mouse settings directly from the command line, which can indeed be a bit tricky. Unfortunately, mate-control-center does not directly expose its settings for command line manipulation the way you might hope. However, you can work around this by using dconf or gsettings, tools for manipulating the GSettings/DConf configuration system, which MATE uses to store its settings.

Here's how you could change the mouse handedness using gsettings:

First, check the current setting:
gsettings get org.mate.peripherals-mouse general handedness

To set the mouse to left-handed:
gsettings set org.mate.peripherals-mouse general handedness 'left'

To set it to right-handed:
gsettings set org.mate.peripherals-mouse general handedness 'right'

These commands change the handedness setting used by the MATE control center. Remember to check the exact path and keys in your version of the MATE environment as they might vary slightly.

For more complex settings that aren't covered by simple gsettings or dconf keys, you'd typically have to write a script that directly interacts with these tools or potentially modifies configuration files in ways that MATE understands.

If you frequently need to switch settings, consider scripting these commands or even creating aliases in your .bashrc or .bash_profile for quick access.

Let me know if this helps or if you run into any issues!
In a world of 1s and 0s, I am the exceptional exception. Linux isn't just my platform; it's my playground.

User avatar
gurfle
Posts: 385
Joined: 2009-06-04 02:08
Location: Seattle, Washington, US

Re: Looking for command line access to mate-control-center settings

#3 Post by gurfle »

Thanks a lot for the detailed suggestions mrnordio2!

For some reason the schema ids on my system are quite different from what you show, but the approach you outline involving gsettings is exactly what I was looking for. For example

Code: Select all

nick@nickspanasonic:~$ gsettings set org.mate.peripherals-mouse left-handed true
nick@nickspanasonic:~$ 
makes the desired change in the control center. :D

Post Reply