Posted: . At: 11:20 AM. This was 7 years ago. Post ID: 11315
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

How to manipulate Xorg windows with a terminal command.

The Windows in an Xorg session may easily be manipulated with this simple utility.

Xdotool. This is a terminal utility to manage Xorg windows.

Firstly, install this simple utility.

jason@jason-desktop:~$ sudo apt install xdotool

Then we can resize a MATE Terminal window.

xdotool search --onlyvisible --classname "gnome-terminal" windowsize %@ 500

This example will focus the Firefox URL bar.

jason@jason-desktop:~$ xdotool search "Mozilla Firefox" windowactivate --sync key --clearmodifiers ctrl+l
Defaulting to search window name, class, and classname

This final example will search for a MATE Terminal window and open pstree in it.

jason@jason-desktop:~$ xdotool search --onlyvisible --classname "mate-terminal" exec /usr/bin/pstree

This is a strange, but useful Linux utility. Give this a try and see what you can come up with.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.