Giter VIP home page Giter VIP logo

Comments (14)

Hibou57 avatar Hibou57 commented on August 20, 2024 2

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.

cosmoharrigan avatar cosmoharrigan commented on August 20, 2024 1

Search by process ID does not work with the latest version:

$ xdotool --version
xdotool version 3.20160112.1

from xdotool.

hilbix avatar hilbix commented on August 20, 2024 1
$ ./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.

lemzwerg avatar lemzwerg commented on August 20, 2024

I got exactly the same problem. Given the usefulness of this option, I would value this as a high-priority bug.

from xdotool.

worenga avatar worenga commented on August 20, 2024

A workaround seems to be to also provide the --name parameter for the given pid

from xdotool.

jordansissel avatar jordansissel commented on August 20, 2024

I'll see what I can do.

from xdotool.

jordansissel avatar jordansissel commented on August 20, 2024

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.

jordansissel avatar jordansissel commented on August 20, 2024

Fixed the warning! :)

from xdotool.

javierabreu avatar javierabreu commented on August 20, 2024

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.

aboettger avatar aboettger commented on August 20, 2024

This is a distribution-specific problem. The latest version on GitHub works.

from xdotool.

PlasmaPower avatar PlasmaPower commented on August 20, 2024

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.

anthonybakermpls avatar anthonybakermpls commented on August 20, 2024

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.

Hibou57 avatar Hibou57 commented on August 20, 2024

@javierabreu, there is a simpler work around, redirecting standard error to /dev/null: xdotool … 2>/dev/null.

from xdotool.

ipaqmaster avatar ipaqmaster commented on August 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.