Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

More fuzzy matching and matching multiple words for window switcher#57

Closed
hugovalk wants to merge 4 commits intoalbertlauncher:devfrom
hugovalk:dev
Closed

More fuzzy matching and matching multiple words for window switcher#57
hugovalk wants to merge 4 commits intoalbertlauncher:devfrom
hugovalk:dev

Conversation

@hugovalk
Copy link
Copy Markdown

@hugovalk hugovalk commented Jan 7, 2019

The Window Switcher plugin is quite useful to me, but I had trouble matching some of the windows on my desktop. This happens because the wm_class is not always descriptive enough. For example:

  • All Java apps have a wm_class that starts with: sun-awt-X11-XFramePeer..
  • Also sometimes the first segment of the wm_class is something generic, like for example main.terminology for the Terminology terminal app.

In all those cases, the 'nice' application name can be found after the dot in wm_class or in the wm_name field.

This change matches all words in the query (splitted on whitespace) with wm_class OR wm_name. This enables me switch to all windows on my screen. Also, it allows switching to the right IntelliJ project, since the project name happens to be in the wm_name.
I have tested this change on Arch Linux with KDE and Ubuntu 18.04 with Gnome.

@hugovalk
Copy link
Copy Markdown
Author

I got the message that you are not a fan of one-line functions :). Your feedback did trigger with me however, so that I want to propose it like this. Now the conditions that decide that a window can be an option are made explicit, namely the window must be not sticky and must match the query.

Although there is still a one-line function, its name has a documenting function. If you don't like it, I can do your proposed solution, but I wanted to show this option to you.

@hugovalk
Copy link
Copy Markdown
Author

hugovalk commented Feb 2, 2019

I got the message that you are not a fan of one-line functions :). Your feedback did trigger with me however, so that I want to propose it like this. Now the conditions that decide that a window can be an option are made explicit, namely the window must be not sticky and must match the query.

Although there is still a one-line function, its name has a documenting function. If you don't like it, I can do your proposed solution, but I wanted to show this option to you.

@ManuelSchneid3r could you please comment?

@VietTralala
Copy link
Copy Markdown

I edited the the script and added some more nice features such as tokenized + fuzzy search and more. However I don't know how to add my code to this pull request. You can check out the code here:
https://github.com/vthuongt/window-switcher-plus

Thank you for the cool launcher!

Hugo Valk and others added 4 commits April 9, 2019 00:11
…ple words. This improves switching windows for java applications, which have a wm_class that starts with sun-awt-X11-XFramePeer.FreeMind. Also sometimes the first segment of the wm_class is something generic, like for example main.terminology. Often, the 'nice' application name can be found in the wm_name field.
@hugovalk
Copy link
Copy Markdown
Author

hugovalk commented Apr 8, 2019

I have still a question open on this PR. Any chance it could be answered? @ManuelSchneid3r

@ManuelSchneid3r ManuelSchneid3r force-pushed the dev branch 2 times, most recently from 686718e to a1ab7f4 Compare November 8, 2020 22:18
@ManuelSchneid3r
Copy link
Copy Markdown
Member

ManuelSchneid3r commented Nov 8, 2020

Unfortunately I let you all wait pretty long. Now I have the problem that I don't know which PR's are valid at all. Therefore I will close all PR's for tentatively. If you want me to reopen the PR let me know. Also it would be nice if you could resolve potential conflicts due to changes in the repo. Sorry for the inconveniences, but I am working on it for a week now. I'm in a hurry. Note that this is a copy paste message. 😉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants