Comments (14)
By the way, there are other strange behaviours with options.
This one works:
search --all --onlyvisible --pid 23507 --class surf
This one does not work, complaining “xdotool: Unknown command: --pid”:
search --all --onlyvisible --class surf --pid 23507
from xdotool.
Search by process ID does not work with the latest version:
$ xdotool --version
xdotool version 3.20160112.1
from xdotool.
$ ./xdotool.static version
xdotool version 3.20161220.1
search --pid
still has a bug. Just muting the warning about the bug does not make the bug go away.
$ ./xdotool.static search --onlyvisible --pid 31981 windowactivate %@
Defaulting to search window name, class, and classname
./xdotool.static: Unknown command: %@
Run './xdotool.static help' if you want a command list
$
does nothing, while
$ ./xdotool.static search --any --onlyvisible --pid 31981 --name "this_window_name_does_not_exist_sqr13rkckf_this_window_name_does_not_exist_sqr13rkckf_this_window_name_does_not_exist_sqr13rkckf_this_window_name_does_not_exist_sqr13rkckf_this_window_name_does_not_exist_sqr13rkckf" windowactivate %@
$
works as expected (and no output whatsoever and the window is activated).
To others: Please note that
--pid
needs the WindowManager option_NET_WM_PID
to be set by the application, which is not the default. For more on this, see http://stackoverflow.com/a/13482052/490291
from xdotool.
I got exactly the same problem. Given the usefulness of this option, I would value this as a high-priority bug.
from xdotool.
A workaround seems to be to also provide the --name parameter for the given pid
from xdotool.
I'll see what I can do.
from xdotool.
Searching by pid works for me on master:
% ./xdotool search --pid 2593
Can't consume 1 args; are only 0 available. This is a bug.
54525953
54527731
54525955
The only bug is that it warns you about consuming args. I'll fix that.
from xdotool.
Fixed the warning! :)
from xdotool.
Ubuntu Gnome 14.04
xdotool version 3.20140217.1
Bug is still present
xdotool search --pid 7558
Can't consume 1 args; are only 0 available. This is a bug.
Ugly workaround:
xdotool search --any --pid 7558 --name "dummy_name_bug_workaround_1gqbvy4o5y8bw3ov5"
from xdotool.
This is a distribution-specific problem. The latest version on GitHub works.
from xdotool.
It seems to still happen to some degree in the latest version. Example:
$ xdotool version
xdotool version 3.20150503.1
$ xdotool search --pid $$
$ xdotool search --any --pid $$ --name "nonexistantname"
48234503
from xdotool.
anthony@bluegreen:~/Data/Code$ xdotool search --pid 15188
Segmentation fault (core dumped)
even if the _NET_WM_PID isn't set it would be nice if we didn't crash.
from xdotool.
@javierabreu, there is a simpler work around, redirecting standard error to /dev/null: xdotool … 2>/dev/null
.
from xdotool.
Tried to search --pid 12345
with xdotool 3.20211022.1
today and while that works I've noticed if you pass additional arguments to do something with the resulting window, matched by pid, xdotool throws Defaulting to search window name, class, classname, and role
instead of treating the --pid argument as a valid solo search parameter.
One shouldn't need to call a nested $(xdotool search --pid $(ps filter for pid by name))
as an argument to xdotool just to return a window ID it can action upon. --pid
should be a valid searching parameter on its own.
from xdotool.
Related Issues (20)
- Impossible to chain "open thunderbird" + "resize window" HOT 2
- xdotool mousemove does not work on fc38
- Random mistake with type command
- Trouble getting xdo_click_window() function to work
- xdotool will not launch on Mint 21.2 Cinnamon
- xdotool key Alt+Tab on Ubuntu, not switch app window
- xdotool sets _NET_WM_NAME as a STRING when it needs to be set as UTF8_STRING
- Extremely strange bug - see attached video. HOT 2
- Add various random timing capabilities
- [Feature] Ability to query and change desktop names
- [Feature] Search for windows that are unmapped or visible on all desktops HOT 1
- Latest xdotool version in Ubuntu 22 repos silently fails on Wayland :sob: apt can't upgrade it, and manual doesn't help HOT 2
- Segfault when running over an ssh connection
- set_desktop --relative does not work for -1 HOT 2
- xdotool cannot send key combinations to Qt-based applications HOT 5
- XGetInputFocus returned the focused window of 1. This is likely a bug in the X server. HOT 1
- Search not seeing Steam Input On-Screen Keyboard HOT 7
- The character ":" is typed as "Q" in VM window HOT 1
- Xdotool works in Firefox but not Brave HOT 1
- behave_screen_edge only works with certain open windows
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xdotool.