Where is xorg.conf meant to go?

I am using and amd system. I found xorg.conf to try to sort out my mouse settings ( a kensington expert mouse) the file was located in /usr/share/doc/xserver-xorg-video-intel/

I don't have an intel anything I am using Ryzen 5. So although I put the code in the file, there is no change with how my mouse works.

the contents of xorg.conf are here: Ubuntu Pastebin

Welcome, @safiyyah237. :wave: :mate: :ubuntu_mate:

Please allow me to explain the X server configuration process to you:

The file that you found is not the X server configuration file; it is actually just a piece of a sample X configuration file. Saving changes to the sample file in /usr/share/doc/xserver-xorg-video-intel will not change the X configuration one single bit. (For the record, it's usually safe to assume that anything in /usr/share/doc is non-essential and exists for informational purposes; no program ever stores real configuration files there, and if one does, that is a very serious bug that should be reported promptly.)

In order for the configuration file to work, create a directory /etc/X11/xorg.conf.d, then save your configuration file inside that directory with a descriptive name ending in .conf. The files are also sorted before being executed, so it's good practice to prepend a two-digit number to the filename, in case later you add extra configuration files which need to be executed specifically before or after this file. I'd suggest saving the file as something like /etc/X11/xorg.conf.d/10-kensington-mouse.conf.

Also important is the fact that that configuration file is missing a capital "S" at the beginning of the file. Even if you put this file into its proper place, it still won't work unless you add that "S".

So, to recap: Create the directory /etc/X11/xorg.conf.d, add an "S" to the very, very start of the file so that the top line reads Section "InputDevice", then save the file as /etc/X11/xorg.conf.d/10-kensington-mouse.conf.

I hope this helps.

I have done exactly as instructed above. Your instructions were clear, thank you!

I hope it is okay that I continue to ask my questions here.

My mouse has 4 buttons, a trackball and a scroll wheel.

At the moment, after creating 10-kensington-mouse.conf everything works except the scrollwheel.

I have also tried creating a shell script for xsession, which is stored at /etc/X11/Xsession.d/
I called the file 40custom_kensington_mouse
https://pastebin.ubuntu.com/p/HcpXhPfQVz/

the contents of the file are here:
https://pastebin.ubuntu.com/p/VXprhpwWPQ/

I still get no joy out of the scroll whell after this implementation.

Also when I run xinput test 9 (the id of my mouse) it picks up on all movements except the scrollwheel.

I see two potential problems.

The first one is, yet again, on the top line of the file:

Default layout

That should be commented out; otherwise the result is a syntax error which prevents the rest of the script from being executed. That line should look like this after you comment it out:

# Default layout

The second potential problem is the last of the following three lines:

	# swap right and back button then swap middle and back button
	xinput set-button-map $mouse_id 1 2 3 4 5 6 7 8 9
	#xinput set-button-map $mouse_id 1 8 2 4 5 6 7 3 9

The middle line (the only executable line of the three) appears to do nothing to the button mapping (at least that's what it looks like to me); it looks like you should comment out the second line and uncomment the third line to get actual results.


But other than that, if you make those changes and the scrolling still doesn't work, check near the top of your ~/.xsession-errors file to see if there's a mention of xinput, 40custom_kensington_mouse, or your mouse. (For the record, a tilda or ~ sign is used to represent your home directory; chances are, there is no real directory on your system named after a single tilda, so don't go looking for it!)