Questions tagged [xdotool]

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

Filter by
Sorted by
Tagged with
1 vote
0 answers
30 views

Map alt-e to ctrl-Tab. Mint, Xfce

I have Linux Mint, Xfce. I want to change tabs in Firefox by pressing Alt-e, rather than the default Ctrl-Tab. In order to do that I must remap those keys in the Xfce UI. In Xfce I can map a key to ...
john-jones's user avatar
  • 1,664
0 votes
0 answers
37 views

fzf output to xdotool instead of the terminal

I can create a fzf.sh script to launch a list of items, allow me to select an item, and print the output of the specific line selected to the terminal: #!/bin/bash cat ~/list.txt | fzf --reverse I ...
jophuh's user avatar
  • 13
0 votes
0 answers
55 views

Help with custom shortcut - Fedora

I am trying to set up a custom shortcut for terminator on Fedora 28. Connected a script to a custom shortcut. The shortcut should either start terminator, or based on whether it is on top or not, ...
iandorr's user avatar
0 votes
0 answers
35 views

How to resize windows beyond monitor size using CLI?

I have two monitors and I'd like to programmatically resize clicked window beyond my first monitor size. I want -39,-138 coordinates and 2355x1202 window size. My first monitor is 1680x1050, the other ...
Kossak's user avatar
  • 649
0 votes
0 answers
202 views

xdotool does not work for terminal window copy paste

I'm using Ubuntu 22 and i have set up two custom shortcuts via settings (works for all windows i have tested so far). xdotool getactivewindow key ctrl+c (-> super+c) xdotool getactivewindow key ...
AliceTheCat's user avatar
0 votes
0 answers
334 views

ydotool: first, backend unavailable, then crash on connection

I'm using the Linux Mint Debian Edition 5 Linux distro. I'm usually satisfied of xdotool I use since years on linux but since few weeks by using it with a browser (chromium, firefox), for long times ...
lm2's user avatar
  • 1
0 votes
0 answers
133 views

Get coordinates with xdotool upon user click and use them in an automation script

I am trying to prompt the user "Click the confirm button" and use the coordinates as a variable in a script. If the user clicks at 1285 786, I would like to click this coordinate once and ...
PerryJones's user avatar
0 votes
1 answer
162 views

Replace xdotool key value with user input

I am trying to write a script that allows a user to input a number and change an xdotool key value to that input. Key inputs in xdotool must be separated by a space, for example xdotool key 1 2 8; So ...
PerryJones's user avatar
0 votes
0 answers
398 views

Bind a key to press another key with sxhkd

I recently switched over from using windows where I used to use AutoHotKey for a few temporary shortcuts and key remapping. This is a small section of the code I used: d:: { sendinput, [ sleep,...
PixelatedXenon's user avatar
3 votes
1 answer
572 views

Xdotool --window function doesn't work

I am currently having a very simply problem, that I cannot for the life of me figure out. The --window function of xdotool does not work. I should be able to open two terminal windows, get the ...
Notacookie's user avatar
0 votes
0 answers
481 views

how to use libinput-gestures in xfce4 to trigger zoom in xfwm-compositor

I was looking for a way to zoom smoothly(continuous zoom) on text or images, and i found that xfwm4-compositor does that by default by pressing meta+scroll. I want to trigger it by pinch in|pinch out ...
white-hat-er's user avatar
1 vote
1 answer
1k views

How can I bind "modifier + arrow" keys to home/end/pageup/pagedown under X?

I have a new 60% keyboard (NuPhy Air60), but it does not have any way to trigger pageup/pagedown or home/end keys. My goal is to recover these commands with a custom keybinding, using a modifier key ...
ChaseMoskal's user avatar
0 votes
2 answers
388 views

Shell Script - run for random number of times in the range

I am trying to automate a shell script that use Xdotol (press B key with random interval -sec.milsec). I am unable to to run script random number of times (right now it is limited to 25 times by count)...
Joroo's user avatar
  • 3
1 vote
0 answers
80 views

Can I make Xephyr toggle user keyboard and mouse?

I need to pilot an X application with my PC, to take scientific measuring. I have an xdotool script which does the job pretty well, but while it's running, I cannot use my PC, which is frustrating and ...
Alessandro Bertulli's user avatar
2 votes
1 answer
183 views

Detecting when an X Window has been closed

I'm running Ubuntu 20.04.5 LTS with the XFCE4 window manager. I'm looking for a way for a shell script to be fired off when a particular X Window has been closed. I know that I can create a program to ...
HippoMan's user avatar
  • 595
1 vote
0 answers
193 views

xdotool creating weird characters and adding some characters in prompt

I am using Zorin OS, based on Gnome. I am using xdotool version 3.20160805.1 I am using zsh with alacritty. However, the following issues can be seen in bash and gnome terminal in different form (it ...
Ahmad Ismail's user avatar
  • 2,648
0 votes
1 answer
504 views

xdotool help maximizing

i'm working on setting up an igel device that auto launches a program upon startup. that part works fine. but when it comes up it's not always coming up maximized/full screen. at first i tried the ...
McClanahan10's user avatar
1 vote
1 answer
74 views

Put four instance of current app's window side by side (Dual Monitor)

I have added the following script to a keybinding. Suppose i have 5 instance of nemo open. It will take the first four and put them side by side. #!/bin/bash WINDOW_ID=$(xdotool getactivewindow) ...
Ahmad Ismail's user avatar
  • 2,648
2 votes
0 answers
156 views

What is the Difference Between xdotool getactive window and xdotool getwindowfocus

The commands xdotool getactivewindow and xdotool getwindowfocus return the exact same output. What is the difference between the two?
Amarakon's user avatar
  • 323
2 votes
2 answers
5k views

How to get current window class name from script?

In my script I want to do different things depending on current active application. How can I get currently active window class name? There is very similar question: xdotool: How to test if current ...
Ashark's user avatar
  • 889
1 vote
1 answer
146 views

xdotool returning different output when executed from crontab [duplicate]

So I was making a script that monitors my app usage. It does so by running a cronjob every minute, and cronjob in question checks which window is focused on and increments its counter by 1. Other ...
Fedja M.'s user avatar
  • 115
1 vote
0 answers
211 views

How can read the content of the active window?

I am trying to create a bash script that selects the content of the active window, copies the content to the clipboard, and saves the content to a file. This file then gets read by some text editor, ...
Chad Winters's user avatar
0 votes
0 answers
359 views

xdotool command chaining

I'd like to pause the vlc player by sending the space key to its main window. What I tried is : xdotool search --class vlc key space And xdotool search --classname vlc key space That didn't work. ...
ychaouche's user avatar
  • 998
3 votes
1 answer
246 views

Run a script when mouse is idle

I want to run a command like xdotool 9999 0 after the mouse has been idle for some time. The goal is to get the mouse out of the way - I like to use my keyboard only, and the mouse often causes ...
Jessica's user avatar
  • 341
0 votes
0 answers
900 views

xdotool: how to switch to specific tab within a particular firefox window

let's say I have 20 tabs open across 2 Firefox windows, the URLs for which i want to save to a file. I could do it manually (with/without firefox tricks such as % <string> as suggested by @...
puwlah's user avatar
  • 519
0 votes
1 answer
97 views

Focus the first Window Where pcmanfm is Running

From the command line, what is the best way to locate the first window where pcmanfm is running, and then give that window focus? pcmanfm does not showcase it's application name on the title bar of ...
Lonnie Best's user avatar
  • 5,113
0 votes
1 answer
895 views

Unable to use my mouse with automation applications like xdotool

So, I just installed Ubuntu as a dual boot system with windows 10 on my PC. I installed xdotool on it and proceeded to use it. I tried "xdotool mousemove 0 0" but nothing happened. My mouse ...
Sk Zafir's user avatar
0 votes
1 answer
2k views

Simple way to query which monitor is currently focused

I'm wondering if there is a tool which can query which monitor is currently focused. I'd like to have a script which changes the wallpaper on the monitor I am currently on (using xwallpaper). From ...
Benjamin Chausse's user avatar
3 votes
1 answer
599 views

How to map a key to a sequence of key and combo, including that key?

I tried to use dxhd with xdotool to prepend each key with Ctrl+G, then type that key, and hit another key, like so #!/bin/sh # @{a-z} xdotool key ctrl+g xdotool type {a-z} sleep 1 xdotool key Tab ...
LeafLover's user avatar
0 votes
2 answers
336 views

Raspbian running headless doing scripted procedures on a internet page using text browser

I am somewhere between a new and intermediate linux user. I am setting up a local network for a small group, and I need to configure an automatic sign-in to a webportal when internet connectivity is ...
Lars Kuur's user avatar
1 vote
1 answer
344 views

How do you make a Bash script repeatedly run while holding down left mouse button?

So, I have a command (xdotool click --delay 40 1) I'm using to repeatedly click the left mouse button. As of now, the script is set up like this: mouse="$(xinput --list | awk -F 'id=|\\[' '/mouse|...
pepay's user avatar
  • 11
0 votes
1 answer
938 views

Is it possible to get the screen/monitor name where a specific application is displayed on?

I would like to find out what screen/monitor (not desktop) a GUI application is displayed on. For example: my mail client is running on my third desktop, which is displayed on my second monitor ("...
user490597's user avatar
1 vote
1 answer
113 views

xdotool - Qt: failed to retrieve the virtual modifier names from XKB

I seem to be unable to make xdotool work. I'm trying to emulate keyboard shortcuts as Super+Left via external output. I looked it up and xdotool seems to do exactly that, emulate keyboard strokes. But ...
Ulises Torrella's user avatar
2 votes
1 answer
257 views

xdotool requiring matching all options

with xdotool I want to identify that dialog box that appears when you use a master password with Firefox. I tried this command: xdotool search --all --name "Password Required - Mozilla Firefox&...
flyingpenguin's user avatar
2 votes
1 answer
6k views

How to type anything with xdotool?

I have some input field of printable ASCII characters, excluding whitespace, that I'd like to pass to xdotool to type as if typed by keyboard. My attempts: echo "type lol lol" | xdotool - ...
caveman's user avatar
  • 173
0 votes
1 answer
456 views

xdotool not working over AWS ubuntu instance

I am working on bash script to automate w3m browser using xdotool I hosted this script in aws ubuntu instance but when i am executing this script i am getting below error Error: Can't open display: (...
faceboook security's user avatar
1 vote
1 answer
244 views

Move window from other (inactive) desktop to current desktop

When using this to fetch window from another desktop to current desktop (which is #0), nothing happens until I focus the desktop with that window - then window immediately moves to the desktop 0. ...
Sebastian's user avatar
  • 133
1 vote
0 answers
578 views

Kwin, xdotool, and wmctrl

I have been trying to do something similar to what described in this thread and create commands to arrange windows in KDE beyond the quicktile functions currently available. I love them, but they are ...
Ntropia's user avatar
  • 271
0 votes
1 answer
462 views

xdotool not working with sxhkd?

ctrl + 2 xdotool type Test Message Added the above line to sxhkdrc with no effect. Using different commands works, but for some reason any xdotool command doesn't work... If i run that command in ...
Carla is my name's user avatar
0 votes
1 answer
2k views

Can't have the --window option work with xdotool click

I'm trying to make an autoclicker (for a farm) in a video-game (Minecraft if you want to know) that works even if the window is in the back. I disabled the game auto-pause upon losing window focus ...
maximumevil's user avatar
3 votes
2 answers
2k views

Bash: How can I check if a website has finished loading?

Problem I am trying to automate a task in my Firefox browser with xdotool. First, I open a new tab in my browser with: firefox -new-tab "www.domain.tld" Then (after the page www.domain.tld ...
Sr. Schneider's user avatar
0 votes
1 answer
313 views

Get event when window has been closed

I try to automate some repetitive tasks with xdotool. In one task I want to automatically save a website to a file. While printing on Firefox there is a progress bar which looks like this: I want to ...
Sr. Schneider's user avatar
2 votes
1 answer
498 views

How can I forward global hotkeys to a program that only listens when the window is in focus?

Let's say there is a program (like OBS, Chrome, or Discord) that accepts hotkeys (to open, save, print, etc) how can I forward a global hotkey like those configured in i3 to a program that only local ...
Evan Carroll's user avatar
  • 30.4k
0 votes
2 answers
144 views

close all except the selected window

I want to close all instance of nemo file browser except the selected window. I have to following script to do that. #!/bin/bash not_to_close=$(xdotool selectwindow) class_name=$(xprop WM_CLASS | cut ...
Ahmad Ismail's user avatar
  • 2,648
2 votes
0 answers
407 views

Unable to send keypress to Xvfb display using XTestFakeKeyEvent in C

Using this short snipped of code I am able to capture events from the keyboard (/dev/input/event1) and print them properly. However, sending them to the Xvfb display using XTestFakeKeyEvent does not ...
Az ayd's user avatar
  • 21
0 votes
1 answer
699 views

How can I search, highlight and click with xdotool in Chrome?

I need to click a string of text hundreds of times, and the text moves around. Let's say that the string is FOO. This is what I have: xdotool key ctrl+f xdotool key f xdotool key o xdotool key o ...
Kristian Nordestgaard's user avatar
2 votes
1 answer
425 views

ctrl scroll to zoom terminal emulator using tmux

I am using the following tmux keybindings to zoom using the mouse wheels. # Ctrl Scroll to Zoom bind-key -T root C-WheelUpPane { run-shell "xdotool key Ctrl+plus" } bind-key -T root ...
Ahmad Ismail's user avatar
  • 2,648
6 votes
4 answers
14k views

How to create a keyboard shortcut to play/pause any audio/video running in the background?

So I bought this keyboard for my laptop that doesn't have media keys on it and I am very used to pressing the play/pause button on my laptop to pause any media playing in the background. With this ...
Mayank Shigaonker's user avatar
0 votes
0 answers
331 views

xdotool only works in browser

I am trying to map a custom keyboard shortcut in Pop_OS! to issue some other keypresses, but I have gotten part of the way with xdotool but I still have some issues as it wont work in applications ...
Alexander's user avatar
3 votes
1 answer
998 views

xdotool: How to test if current window is of certain class in bash script?

I want to do some specific things in a bash script if the current window belongs to the Firefox class I am aware of: xdotool getactivewindow and xdotool search -class firefox then I could do some ...
pietrodito's user avatar