oliverschwendener / ueli

Cross-Platform Keystroke Launcher
https://ueli.app
MIT License
3.65k stars 241 forks source link

custom command with parameters #50

Closed maku closed 6 years ago

maku commented 6 years ago

Is it possible to define custom commands with parameters?

e.g. executionArgument

 {
        "name": "openwithcode",
        "executionArgument": "!code {0}"
 }

where {0} is the input file / directory:

openwithcode c:\my-project

oliverschwendener commented 6 years ago

Thank you for your feedback! This is a very good idea, I will look into it as soon as possible!

maku commented 6 years ago

@oliverschwendener Great - BTW, I like ueli very much...

oliverschwendener commented 6 years ago

I renamed the previous "customCommands" to "shortcuts" and added a new pattern for "customCommands" with parameters.

Shortcuts

The goal with shortcuts is that you can quickly launch urls, folders, files with a name (and without any parameters).

Here an example of the config file:

"shortcuts": [
  {
    "name": "Whatsapp",
    "executionArgument": "https://web.whatsapp.com"
  },
  {
    "name": "Data",
    "executionArgument": "D:\\My-Data"
  }
]

So you should be able to find the shortcut to https://web.whatsapp.com with Whatsapp or Wha or Wahtspp as an user input. Or you should be able to find the shortcut to D:\\My-Data with data as an user input.

Custom commands

The goal with custom commands is that you can specify a special command and add custom parameters.

Here an example of the config file:

"customCommands": [
    {
        "name": "Open with code: ",
        "executionArgument": "!code",
        "prefix": "openwithcode"
    }
]

With this example you should be able to open vscode at a specified folder. For example if you type in openwithcode C:\projects\my-project opens vscode at the specfied location.

These changes will be included in the next release.

maku commented 6 years ago

@oliverschwendener Great, I am looking forward to give it a try...