sway-launcher-desktop icon indicating copy to clipboard operation
sway-launcher-desktop copied to clipboard

Use it as a finder / search for files

Open tgy opened this issue 3 years ago • 6 comments

Is it possible to configure sway-laucher-desktop to also search for files (fuzzy finding with fzf) and open them with xdg-open?

In other words, is it possible to use it for searching not only binaries and desktop entries but also search files and open them?

tgy avatar May 06 '21 11:05 tgy

This should be possible with a custom provider, yes. There's a description of how it works in the Readme. The use of custom providers replaces the builtin ones though, so using a custom provide in addition to the builtin ones is currently not possible

Biont avatar May 06 '21 12:05 Biont

Too bad they cannot be combined.

I think this would be a great addition to this launcher. Basically, it would be a use-case similar to what the Spotlight launcher does for macOS.

I often find myself wanting to access a specific document (like a PDF or an image) and would love to be able to quickly fuzzy find it with `sway-launcher-desktop'.

But loosing the ability to also launch applications is a big downside.

tgy avatar May 06 '21 13:05 tgy

I totally agree and I've been thinking about this myself. Maybe we could add a flag that controls whether or not to include the builtins. Or add some way to refer to them in a provider config file (or: support this kind of flag in the file parser).

Biont avatar May 06 '21 15:05 Biont

@Biont it's not too bad if we want to include the defaults providers, just add something like this in the config file:

[desktop]
list_cmd=/path/to/sway-launcher-desktop.sh list-entries
preview_cmd=/path/to/sway-launcher-desktop.sh describe-desktop "{1}"
launch_cmd=/path/to/sway-launcher-desktop.sh run-desktop '{1}' {2}

[command]
list_cmd=/path/to/sway-launcher-desktop.sh list-commands
preview_cmd=/path/to/sway-launcher-desktop.sh describe-command "{1}"
launch_cmd=alacritty -e {1}

however, it won't keep in sync if you want to change something, add another, etc. maybe it would be enough to check that the config file starts with the line !keep builtin providers (or anything similar you deem appropriate)

mathroc avatar Oct 13 '21 20:10 mathroc

Cool. I was thinking this would work, but I never actually tried. Good to know. I guess I should rather think about documenting thinks like this. Thanks!

Biont avatar Oct 14 '21 07:10 Biont

I just added a section in the README: 01618435a543af7926f658f6f33f1e187c03bd55

Biont avatar Oct 14 '21 07:10 Biont