\
, as far as I've seen. I stand by my earlier suggestions, which work locally—in particular the regex:
one can be used with any odd characters. Do you have any other profiles that might cover the same directory and pick up unwanted files?
on_suggest
should create a new item and show it to the user with set_suggestions()
. You would set the user_input
as a field of the item. If the user selects that item and activates it, your plugin would then receive the item as an on_execute
call.
Thank you, Fran, that is the way I've been trying to do this, but somehow pressing enter after typing my parameters does simply nothing. I guess it has somethong to do with the object properties but I couldn't really find out, what they actually do... Any ideas?
`def on_suggest(self, user_input, items_chain):
if not items_chain or items_chain[-1].category() != kp.ItemCategory.KEYWORD:
return
if not user_input:
self.history = []
suggestions = []
suggestions.append(self.create_item(
category=kp.ItemCategory.EXPRESSION,
label=user_input,
target=user_input,
args_hint=kp.ItemArgsHint.FORBIDDEN,
hit_hint=kp.ItemHitHint.IGNORE))
self.set_suggestions(suggestions, kp.Match.ANY, kp.Sort.NONE)
def on_execute(self, item, action):
kpu.set_clipboard(str(item))`
Does anybody know if it is possible to force the use of a prefix? For example I have FileCatalog setup to show some files, I would like the files to be hidden from the results unless I type in "find {files-to-find}".
Eg: If I type in chrome, it only shows my google chrome shortcut from the start menu, but if I type in "find chrome" it will show files from the files catelog that include "chrome" such as "chrome.png" etc etc
Any help is appreciated, thank you!
choco
. However, searching for "keypirinha" in the menu will find the program. Keypirinha can also start on login, so a menu entry would be redundant :-)
I have tried adding
[profile/ExeOnly]
include_hidden = no
include_dirs = no
include_files = yes
# filters = + ext: ${env:PATHEXT};.lnk
filters = + ext: .lnk
paths = $(var:KNOWNFOLDER_PROFILE)\bin\**
to the filescatalog.ini
Hi there. I'm currently facing issue with FileCatalog Python Error: [WinError 1223. I have a Skydrive business folder (Onedrive business) catalogued, but trying to execute any program is raising this error.
I think it might be related to Microsoft Defender, but as it's a corporate laptop I can't do much at that.
I tried to overcome this situation by using the "open_with" parameter, by doing:
open_with = cmd /c {}
But paths with spaces are being problematic. Using cmd /c "{}" didn't work as expected. Any suggestion?
Is it possible to run multiple instances of KP at the same time with different configuration settings, or is it forced to run as a singleton instance? I've tried downloading the portable x64 version into two different directories independently and running them, but that doesn't seem to work. Whatever instance is running stays running, and the new executable clicked on does not launch.
The use case in mind is having catalogs be as narrow as possible: using ignored_packages = <All> - FilesCatalog
for each instance, and then defining custom catalogs on a per-instance basis. I use AutoHotkey extensively, so launching different instances by generated hotkey presses is not a barrier.
I would be equally happy if it were possible for me to actually remove catalog results by prefix. I.e., When I type my-prefix
, only things that begin with my-prefix
show up: my-prefix file1.txt
, my-prefix file2.txt
, and so on.
hotkey_paste
with a profile prefix (e.g., apps:
) may work for the use case I have envisioned, but there are two issues with how it seems to be working. First, it trims spaces in the clipboard text. So if what I have in my clipboard is md:
(to show markdown files in a specific directory), the trailing space is removed. Second, and much more importantly, when KP is triggered with hotkey_paste
, the pasted text is selected, meaning if I press a key, the text that was pasted gets deleted rather than added on to. Ordinarily, I would just try sending a {Right}
keypress after triggering the hotkey, but there is lag time as the launcher opens. Setting a delay before sending works, but then there is a delay introduced. It would be much better if it were possible to not have the pasted text selected when KP is opened in this manner. Would that be possible?
While not completely ideal, I have figured out a way to get around the hotkey_paste
issue using AutoHotkey's WinWaitActive. (This script assumes that hotkey_paste = Ctrl+Win+L
):
#NoEnv
#SingleInstance force
SetWorkingDir % A_ScriptDir
SendMode, Input
*CapsLock::
SendInput ^#l
WinWaitActive ahk_exe keypirinha-x64.exe
SendInput {Right}{Space}
If you type extremely fast, you may still overwrite the pasted content