Questions tagged [xdotool]

a command line tool that can simulate X11 keyboard input and mouse activity and manipulate windows

xdotool lets you automate window manipulation and inject events under . In can be used from the command line and in scripts. Its main capabilities are:

  • List and filter windows by application class, title, process ID, etc.
  • Move and resize windows, iconify or maximize them, change the focus, etc.
  • Switch to another desktop (workspace), and move windows across desktops.
  • Simulate keypresses and mouse actions, e.g. to enter input and trigger commands in GUI applications.

It works through X11's XTEST extension and other Xlib functions.

127 questions
30
votes
1 answer

What are the differences between xdotool and xautomation?

xdotool and xautomation are two command line X11 automation tools. I've used the former for a while and only recently found out about the existence of the latter, and I'm curious to know what someone who used both for a while has to say about…
glS
  • 796
  • 3
  • 9
  • 20
20
votes
4 answers

xdotool: How to search for window by title and class with different patterns (similar to AutoHotkey)

xdotool lets you search for windows using its search subcommand. I need to locate a window, that has class 'gvim' and title containing word 'TODO'. How do I do this? What I've tried: You can do xdotool search --name --class, but it would only…
t7ko
  • 475
  • 1
  • 3
  • 11
16
votes
3 answers

How to get window id from xdotool Window Stack

I need id of window which is active or focused. I try to use xdotool command. There is command: xdotool getactivewindow the result is saved to window stack. I want to get widnow id from this window stack. Command xdotool getactivewindow…
Mariusz
  • 347
  • 1
  • 2
  • 8
14
votes
3 answers

How to get window ID from process ID

This command will get the PID of the xterm process launched: xterm & export APP_PID=$! How can I get the window ID associated to that process (the xterm window ID)? I mean, the ID that xdotool selectwindow would return after clicking on the xterm…
nightcod3r
  • 952
  • 2
  • 16
  • 32
13
votes
2 answers

Can I simulate mouse movements via terminal without xdotool?

I would like to write a script to prevent a computer from locking by virtually wiggling the mouse. However, I do not have xdotool on the computer that I am using, and I cannot install since I am not root. Is there a way to move the cursor without…
ichbinallen
  • 313
  • 2
  • 4
  • 9
12
votes
1 answer

How can I press the Windows key with xdotool

How can I press the start key with xdotool? By start key, I mean the key with the Windows icon.
user123456
  • 4,758
  • 11
  • 52
  • 78
11
votes
2 answers

Keyboard emulation in Wayland

Is there a way to make xdotool or xte or any other alternative to work in Fedora 26? I'm trying to emulate keypresses (using xbindkeys), e.g. pressing Alt+B would emulate pressing Ctrl+Shift+B. But apparently neither xdotool nor xte work in Wayland…
iLemming
  • 533
  • 2
  • 6
  • 14
11
votes
2 answers

How to copy text from command line to clipboard without using the mouse?

I'm trying to figure out a way to copy the current text in a command line to the clipboard WITHOUT touching the mouse. In other words, I need to select the text with the keyboard only. I found a half-way solution that may lead to the full…
Sancho Pancho
  • 123
  • 1
  • 6
11
votes
2 answers

`xdotool` does not send keys

I am trying to send keystrokes via xdotool. However, sending does not work properly. Below is the log of a script that should select all the text in Gedit and copy it (but it does nothing instead), along with its output (captured by redirecting…
Eleno
  • 1,849
  • 4
  • 27
  • 39
9
votes
3 answers

Can xdotool be used on some window not in the front?

On Ubuntu desktop, can I use xdotool to mouse click (e.g. click a link) and press some keys (e.g. Ctrl+s) on a window (e.g. Firefox's window) that is not in the front, so that I can work on another different window which may need to lie on top of…
Tim
  • 98,580
  • 191
  • 570
  • 977
8
votes
3 answers

How can I automate window tiling with a custom width? (Cinnamon)

I am running Linux Mint 17 Cinnamon 2.4.8. I really like xdotool, but it conflicts with Cinnamon's awesome snapping/tiling feature. If I run the following command, it does NOT work if the current window is snapped to a…
TuxForLife
  • 2,789
  • 1
  • 13
  • 19
7
votes
1 answer

Run program on a key press without interupting the key event

Is it possible to bind a (global) key press to some command and still not disrupt the key press from completing? What I mean is, if I try the bindkey solution posted elsewhere here: # In file: ~/.xbindkeysrc # Bind key 'q' to running…
Zorawar
  • 825
  • 8
  • 18
7
votes
1 answer

emulate key-combination with xdotool

I am using Xephyr as a nested X server. When I am in Xephyr window and pres the key combination Control_L+Shift_L, Xephyr grabs my input (mouse, keyboard). This grab can be released with Control_R+Shift_R, as in API documentation for awesome, a…
Michael Boies
  • 156
  • 1
  • 6
  • 22
7
votes
1 answer

Resizing a maximized window from the command line

The following script fails to resize an already maximized window: wmctrl -i -r :ACTIVE: -b remove,maximized_vert,maximized_horz xdotool windowunmap --sync xdotool windowmap --sync wmctrl -r :ACTIVE: -e 0,300,168,740,470 I am pretty sure the…
George
  • 1,799
  • 2
  • 25
  • 30
6
votes
3 answers

minimizing & raising a window from a shell script

I am trying to run a script that will check internet speed on a linux machine with gui, bring the terminal window down and when the query is finished , the window will come up with the answer. as for the time being- i can take the window down, but…
soBusted
  • 621
  • 2
  • 7
  • 12
1
2 3
8 9