Photo by Ilya lix on Unsplash

Photo by Ilya lix on Unsplash

Configuring X Window input and output devices

Tailor-Made

Article from ADMIN 67/2022
By
Two command-line tools, xandr and xinput, let you optimize your X Window display from the terminal.

An X Window System provides several components to allow users to interact with a graphical interface. An X server lets applications, also known as X clients, use a graphical display within windows. The window manager determines the look and feel of such an interface, as well as takes care of how the windows are handled (e.g., enlarging, reducing, or closing them). A desktop manager, which is ultimately responsible for bringing order to this kind of graphical interface, displays icons, menus, panels, and other elements on the desktop.

Even though various graphical tools exist to optimally adapt your existing hardware to the X Window System, you can also do this from a terminal using command-line tools. You simply need to use the right tool to make the setting you need. In this article, I will show how to adjust some typical display settings from the terminal using xandr and xinput.

Setting up the Display

One problem that occurs time and time again relates to the correct display resolution. If you use several monitors or also use a projector, it is often difficult to determine the correct order of the devices so that you can use a mouse to easily switch between the windows of the different devices. You may also need to rotate the image shown on a display – for instance, if you have installed a projector upside down on the ceiling or want to use a monitor in portrait mode. To solve all of these problems, you can use the xrandr tool.

With xrandr, you can configure the X Window System's Resize and Rotate (RandR) extension to adjust the main window, which the X clients use for display purposes, to suit your needs. Using xrandr --listmonitors gives you an overview of all the monitors connected to the system and their current configurations:

xrandr --listmonitors
Monitors: 3
0: +*eDP-1
...
Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Using a Bash script to mirror external monitors
    If you use your Linux laptop for public presentations – or other tasks that require an external display – you are probably familiar with the problem of making your computer's display resolution fit the external device. This homegrown script offers an easy, automated solution.
comments powered by Disqus
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs



Support Our Work

ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.

Learn More”>
	</a>

<hr>		    
			</div>
		    		</div>

		<div class=