6

Is it possible to search for both the --class and --name using xdotool?

xdotool search --all --onlyvisible --class "some_val" --name "another val"

The above returns an error because the first condition, --class, already returns window ids before --name can be used to filter the results:

 xdotool: Unknown command: --name
dgo.a
  • 779

1 Answers1

5

The tricky thing is that --class, --name, and --classname options to the search command do not take an argument. (This has tripped many, I think.) They modify what the search command looks at.

Chaining searches doesn't work, either; the second search discards the results of the first.

All I can suggest is to use shell scripting. Here's one way:

( xdotool search --all --onlyvisible --class 'some_val'
  xdotool search --name 'another val' ) |
    sort | uniq -d