xdotool requiring matching all options

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" --classname Firefox

But, it gives an error:

xdotool: Unknown command: --classname Run 'xdotool help' if you want a command list

I´m not aware what could be wronge here, I have two options and both must match, thus I use --all.

Antwort1

By default, Xdotool looks for windows that match any condition, the default condition being --name --classname --class, thus these equivalent commands get all windows whose title, instance or class contain "foo":

xdotool search foo 
xdotool search --name --classname --class foo 

In the maintainer's words,

It's a bit confusing, I'm sorry.

The --all and --class [and --name and --classname] flags act as switches and do not take arguments.

You can, however, use command chaining to do what you want:

xdotool search --name Password search --classname Firefox

The windows matched by the first search are "piped" onto the second search command.


Bear in mind:

  • --name matches the window title, as in WM_NAME or _NET_WM_NAME in Xprop's output.
  • --classname matches the first WM_CLASS string in Xprop's output.
  • --class matches the second WM_CLASS string in Xprop's output.

verwandte Informationen