Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"--all" and "--any" flags don't work with --class #180

Open
eater opened this issue Aug 9, 2017 · 2 comments
Open

"--all" and "--any" flags don't work with --class #180

eater opened this issue Aug 9, 2017 · 2 comments

Comments

@eater
Copy link

eater commented Aug 9, 2017

$ xdotool search --all --pid "1424" --name "gvim"
98566147
$ xdotool search --all --class "gvim" --name "gvim"
xdotool: Unknown command: --name
Run 'xdotool help' if you want a command list
@jordansissel
Copy link
Owner

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

The --all and --class flags act as switches and do not take arguments. The error you are getting is because the --class flag takes no arguments, but the --pid flag does.

In your first example, it says "Search for a window with all of the following properties: PID is 14224, name matches the search argument, the search argument is gvim".

The argument "gvim" In your first command is an argument, as in xdotool search gvim and --name just says "The argument should match the window name". It just enables which properties to search (name, class, etc). I realize this is confusing :\

The second command fails because --class takes no arguments, so xdotool interprets as if you had given two different commands (xdotool lets you chain commands together). The second command is seen as --name and it reports it invalid.

The way xdotool implements search could be better, and I'm open to ideas about improvements.

@tadly
Copy link

tadly commented Aug 31, 2017

Just hit the same issue and not only is it confusing, it also limits ones possibilities greatly as the class, the instance (what xdotools refers to as classname I assume) and the title (what xdotools refers to as name) can be completely different.

My suggestion would be to allow combined searches for each element rather than having it switch what will be searched for limiting what you can do.

A search could than look something like this.

xdotool search --class '^UXTerm$' --classname '^main-term-right$' --name "I don't need titles"

I intentionally omitted --all and --any. There's no need for them.
Other options like, --maxdepth, --onlyvisible etc. are fine to stay IMO

I think i3 does a good job with how it handles "window searching"

I hope I made any sense ':D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants