Questions tagged [xdotool]
a command line tool that can simulate X11 keyboard input and mouse activity and manipulate windows
115
questions
0
votes
0
answers
18
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?
0
votes
0
answers
16
views
xdotool key ctrl+c does not stop
I am trying to make a bash script which attaches to a tmux session, and uses ctrl+c in each tab to terminate it. Due to the nature of the commands run in the tmux session, a tmux kill command would ...
0
votes
1
answer
100
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 ...
1
vote
1
answer
27
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 ...
1
vote
0
answers
31
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, ...
0
votes
0
answers
50
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. ...
2
votes
0
answers
48
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 ...
0
votes
0
answers
105
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 @...
0
votes
0
answers
34
views
Force xdotool to use XTEST rather than XSendEvent
So I wrote a script that will send a repeated . keypress to a window of my desire. Mostly a wrapper around
value=`xdotool selectwindow`
[..]
xdotool key --window $value --delay 84 --repeat 50000 ...
0
votes
0
answers
67
views
xdotool get to work with windowsfocus and sync option to type correctly
I am trying to send to GUI programs lines stored in txt files, which contains
2>&1 <<
via xdotool.
My current script bases on
xdotool type --window $steam_window --delay 0.8 --...
0
votes
0
answers
17
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 ...
0
votes
1
answer
145
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 ...
0
votes
0
answers
49
views
xdotool. Numpad arrows selecting text instead of just moving caret
I have a problem with xdotool. I have shortcuts binded to arrow keys, so I can't use them. I want to use numpad ones instead. But numpad arrows all acting like if Shift modifier is pressed, they ...
0
votes
0
answers
18
views
What window_ids do xdotool return after searching leafpad?
I run xdotool search --pid <pid> for leafpad, and its return three window_ids, where only the last one is correct. What does other mean?
0
votes
1
answer
195
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 ...
1
vote
1
answer
77
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
...
0
votes
2
answers
80
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 ...
0
votes
0
answers
20
views
Xdotools help with Kiosk
I have a PI set up in Kiosk mode. What I want to do with is is have it reload a site when a button is pushed on the key board. I have tried to use a timer with CTRL+W and tried to use alt+back arrow. ...
1
vote
1
answer
84
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|...
0
votes
1
answer
127
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 ("...
1
vote
1
answer
52
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 ...
2
votes
1
answer
104
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&...
2
votes
1
answer
955
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 - ...
0
votes
1
answer
221
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: (...
1
vote
1
answer
61
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.
...
1
vote
0
answers
232
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 ...
0
votes
1
answer
199
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 ...
0
votes
1
answer
727
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 ...
3
votes
2
answers
789
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 ...
0
votes
1
answer
78
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 ...
2
votes
1
answer
263
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 ...
0
votes
2
answers
76
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 ...
2
votes
0
answers
172
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 ...
0
votes
1
answer
260
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
...
2
votes
1
answer
258
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 ...
1
vote
2
answers
7k
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 ...
0
votes
0
answers
147
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 ...
3
votes
1
answer
406
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 ...
1
vote
1
answer
2k
views
Script/keyboard shortcut to minimize all other windows
I would like a global keyboard shortcut super+down to minimize all windows except the active one, so that I can see that window with just the desktop in the background. A nice extra would be to ...
1
vote
1
answer
120
views
vim is showing strange behavior in bashscript
#!/bin/sh
action() {
screen -X stuff "xdotool key Ctrl+a $1"$(echo '\015')
}
action bar
screen
action 0
action Tab
action 1
action S
screen
action Tab
action 2
action Tab
vim
#action Tab
#...
1
vote
1
answer
224
views
xdotool issues with keyboard layout configurations having non-US defaults
I tried using the xdotool commandline on a Chrome window in Debian, typically by doing:
sleep 2 && xdotool type "2"
# Switch to the Chrome window and focus on the relevant text field
# before ...
2
votes
0
answers
146
views
key binding running xdotool unexpected behaviour
I've programmed a key to run xdotool when it's pressed. But for some unknown reason xdotool is only sending keystrokes when the binded key is released, except when a non-active window is sent the ...
0
votes
1
answer
737
views
Release modifier keys after using xdotool
I use the following command in a bash script file:
xdotool type --clearmodifiers $(xclip -o -sel c)
I invoke it with a shortcut such as CTRL+SHIFT+e
The action works as expected. However, after it ...
5
votes
1
answer
184
views
Parsing "shell friendly" output
I would like to get output from
xdotool getactivewindow getwindowgeometry --shell
to local variables in bash.
Thought I might could do something like:
declare -A wp=( $(xdotool getactivewindow ...
0
votes
0
answers
266
views
xdotool send keystroke even when windows does not have focus
I've written the attached script in order to keep my external monitor alive while I'm not typing on it. I'm using fvwm, and have multiple named windows open. The script successfully types A every ...
1
vote
0
answers
243
views
xdotool not bringing active window in front while VLC is fullscreen
VLC media player has two options to show video in fullscreen. The first is called "fullscreen mode" F11 shortcut and the second is "fullscreen" with "f" shortcut.
Both modes appear the same, but the ...
0
votes
2
answers
2k
views
How to create a kill switch for xdotool?
I used xdotool to automate some actions. It takes data from a spreadsheet, and "types" it into a Web site, instead of me having to manually copy and paste all of that data over, saving hundreds of ...
2
votes
0
answers
794
views
xdotool and new terminal windows
I recently discovered the amazing xdotool command and was going to make a bash-script to open four windows, resize, and reposition them for work.
Before, I could use the command xdotool key ctrl+...
3
votes
1
answer
650
views
Xclip command works in shell but not in keyboard shortcut
I have to paste my email often during the day, and typing it is time consuming. That is why I am searching for a way to do this with a button press.
The following command works to place my mail on my ...
1
vote
1
answer
214
views
How to automate a series of keystrokes involving two GUI applications
I have two windowed applications that I need to send a series of keystrokes to. I need to Alt-Tab back and forth between the apps, and I'd like to be able to reduce the number of keystrokes from six ...