Flow.Launcher icon indicating copy to clipboard operation
Flow.Launcher copied to clipboard

Custom Query Shortcut

Open taooceros opened this issue 2 years ago • 11 comments

  1. Expandable Shortcut
  2. some environmental variables. e.g. clipboard

taooceros avatar Dec 23 '21 22:12 taooceros

Do we want to reference to variable? So probably a later shortcut can reference back to an earlier shortcut (then we need a move up and move down button).

taooceros avatar Mar 26 '22 16:03 taooceros

It will be interesting if we introduce variable like {{clipboard}}

taooceros avatar Mar 26 '22 16:03 taooceros

is this how you would use env variables?

image

jjw24 avatar Jun 05 '22 10:06 jjw24

some environmental variables. e.g. clipboard

How do you use this with clipboard?

jjw24 avatar Jun 05 '22 10:06 jjw24

Shortcut is not being saved.

Oh forget to add jsoninclude i guess. Thanks for checking.

taooceros avatar Jun 05 '22 14:06 taooceros

some environmental variables. e.g. clipboard

How do you use this with clipboard?

I manually set {clipboard} to be the content in clipboard.

taooceros avatar Jun 05 '22 14:06 taooceros

some environmental variables. e.g. clipboard

How do you use this with clipboard?

I manually set {clipboard} to be the content in clipboard

Can you show me a screenshot how it's setup?

jjw24 avatar Jun 06 '22 23:06 jjw24

some environmental variables. e.g. clipboard

How do you use this with clipboard?

I manually set {clipboard} to be the content in clipboard

Can you show me a screenshot how it's setup?

https://github.com/Flow-Launcher/Flow.Launcher/blob/0c75dfe46fc9a0116f6c69f9aec0397298df0a96/Flow.Launcher/ViewModel/MainViewModel.cs#L679

just write {clipboard} in the expanded query.

taooceros avatar Jun 07 '22 13:06 taooceros

some environmental variables. e.g. clipboard

I thought you added this user side that allows expanding of env variables?

jjw24 avatar Jun 08 '22 03:06 jjw24

some environmental variables. e.g. clipboard

I thought you added this user side that allows expanding of env variables?

oh that might be interesting as well. We can add that feature

taooceros avatar Jun 08 '22 04:06 taooceros

Shortcut is not being saved.

@taooceros

jjw24 avatar Jul 17 '22 20:07 jjw24

Can Plugins create shortcuts? If so, shortcuts shouldn't be limited to pure string replacement. They should have the ability to call a function like string foo().

And what if user wants to search the shortcut word rather than triggering the shortcut? Like if I want to search ab but there's a shortcut ab->123456. What if I want to search a file or whatever else called "ab"? Maybe this is a inappropriate shortcut but we should consider this case.

VictoriousRaptor avatar Oct 05 '22 17:10 VictoriousRaptor

Can Plugins create shortcuts? If so, shortcuts shouldn't be limited to pure string replacement. They should have the ability to call a function like string foo().

I didn't get the idea? you mean let plugin provide variable?

And what if user wants to search the shortcut word rather than triggering the shortcut? Like if I want to search ab but there's a shortcut ab->123456. What if I want to search a file or whatever else called "ab"? Maybe this is a inappropriate shortcut but we should consider this case.

I guess that's user choice? We can always require prefix $ for shortcut though, but I think it is convenient to do a full string replacement if user only type shortcut.

taooceros avatar Oct 06 '22 04:10 taooceros

I didn't get the idea? you mean let plugin provide variable?

Yes.

VictoriousRaptor avatar Oct 06 '22 04:10 VictoriousRaptor

I didn't get the idea? you mean let plugin provide variable?

Yes.

Ah that's cool. Though I feel like it is not super easy? We may need extra api for that. Mind leave it in the future?

taooceros avatar Oct 07 '22 18:10 taooceros

I tried to to finish this PR. One last thing to decide, is how to let users know there are builtin shortcuts like {clipboard}? Just write them down in documents or put them in the shortcut list?

VictoriousRaptor avatar Oct 08 '22 17:10 VictoriousRaptor

I tried to to finish this PR. One last thing to decide, is how to let users know there are builtin shortcuts like {clipboard}? Just write them down in documents or put them in the shortcut list?

I thought they are currently displayed like this in this PR? image

jjw24 avatar Oct 09 '22 19:10 jjw24

What plans do we have for adding built in variables apart from clipboard?

jjw24 avatar Nov 06 '22 03:11 jjw24

What plans do we have for adding built in variables apart from clipboard?

Not yet.

VictoriousRaptor avatar Nov 06 '22 04:11 VictoriousRaptor

Explorer plugin doesn't play well with {, getting exception when I type {cli, need to fix that in Explorer.

jjw24 avatar Nov 06 '22 04:11 jjw24

What plans do we have for adding built in variables apart from clipboard?

Not yet.

So what else can we do with this functionality? Clipboard access can be done better with the Clipboard plugin I feel.

jjw24 avatar Nov 06 '22 04:11 jjw24

Explorer plugin doesn't play well with {, getting exception when I type {cli, need to fix that in Explorer.

Maybe it is related to the vscode workspace plugin (default action word {). I remember I had similar issues when testing along with the plugin.

What plans do we have for adding built in variables apart from clipboard?

Not yet.

So what else can we do with this functionality? Clipboard access can be done better with the Clipboard plugin I feel.

This design is to provide functionality more than simple static string replacment. I don't have any good idea about what else we can do with it yet.

VictoriousRaptor avatar Nov 06 '22 04:11 VictoriousRaptor

Maybe it is related to the vscode workspace plugin (default action word {). I remember I had similar issues when testing along with the plugin.

Nah, actually reproducible with Dev branch.

jjw24 avatar Nov 06 '22 05:11 jjw24

This design is to provide functionality more than simple static string replacment. I don't have any good idea about what else we can do with it yet.

Feels like half-baked at the moment because users wouldn't be able to add new ones in and clipboard access can be done with the clipboard plugin. What about pulling it out to a separate pr?

jjw24 avatar Nov 06 '22 05:11 jjw24

This design is to provide functionality more than simple static string replacment. I don't have any good idea about what else we can do with it yet.

Feels like half-baked at the moment because users wouldn't be able to add new ones in and clipboard access can be done with the clipboard plugin. What about pulling it out to a separate pr?

Maybe we should discuss it later, when other problems of this pr are fixed.

VictoriousRaptor avatar Nov 06 '22 05:11 VictoriousRaptor