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

Feature Request: focus title_regex #505

Open
MrBalonio opened this issue Oct 17, 2017 · 1 comment
Open

Feature Request: focus title_regex #505

MrBalonio opened this issue Oct 17, 2017 · 1 comment

Comments

@MrBalonio
Copy link

Would it be possible to add focus title_regex?
The feature would be useful when you have an application with multiple windows and you would like to focus directly to a specific window.
Example:
Terminal application with three windows open.
Terminal windows can have in the title the following: ~/path/to/application ⌘2
The focus title_regex would focus the application first and then pass focus to the window matching the title
Syntax could look something like this:
bind i:${hyper} focus 'Terminal':TITLE_REGEX=.*⌘1

Thanks for your hard work in such an awesome tool.

@MrBalonio MrBalonio changed the title focus title_regex Feature Request: focus title_regex Oct 17, 2017
@JanLunge
Copy link

JanLunge commented Feb 7, 2018

you can do something like that in javascript already i use regex to position windows here is my sample

var regexmove = function (regex) {
  return {
    "operations": [function (windowObject) {
      var title = windowObject.title();
      if (title !== undefined && title.match(/^Developer\sTools\s-\s.+$/)) {
        //chrome dev window
        windowObject.doOperation(bookRightHalf);
      } else if (title !== undefined && title.match(/^Firebug\s-\s.+$/)) {
        //firefox dev window
        windowObject.doOperation(bookRightHalf);
      } else if (title !== undefined && title.match(/.+Google\sPlay\sMusic.+$/)) {
        //google play music
        windowObject.doOperation(bookFull);
      } else {
        //normal windows
        windowObject.doOperation(wideFull);
      }
    }],
    "ignore-fail": true,
    "repeat": true
  };
}

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

2 participants