Biont / sway-launcher-desktop

TUI Application launcher with Desktop Entry support. Made for SwayWM, but runs anywhere
GNU General Public License v3.0
606 stars 28 forks source link

Swap to upside down/reversed output #53

Open steveb-123 opened 2 years ago

steveb-123 commented 2 years ago

The default output, with the prompt at the bottom feels unexpected to me. After a week of use I'm still looking up for a moment first.

Is there any straightforward way to reverse, or otherwise customise the order of the output?

I want to switch so that the prompt is at the top and the search list order shows the best match at the top.

Apologies if I missed something, I glanced through the .sh but it didn't leap out at me. I appreciate the simplicity of the project so I understand that this might be out of its scope or annoying to implement.

Thanks!

Biont commented 2 years ago

This should be possible by invoking fzf with the proper arguments as described here.

The real question is what's the best way to pass these arguments from the launcher. There's another issue that explores a generic way to pass fzf arguments into the launcher which is probably preferable to single-purpose flags for things like reversing the layout. I will link to the issue when I am back at my PC

steveb-123 commented 2 years ago

Thanks for the pointer ...I didn't realise this was all just coming straight out of fzf!

Adding --reverse and removing the preview lines in that section got it to how I like it.

It would be worth including some generic way to remove or alter default included flags as well as adding them.

For any cut n pasters, here is the edited section...

readarray -t COMMAND_STR <<<$(
  fzf --ansi +s -x -d '\034' --nth ..3 --with-nth 3 \
    --print-query \
    --reverse \
    --no-multi --cycle \
    --prompt="${GLYPH_PROMPT-# }" \
    --header='' --no-info --margin='1,2' \
    --color='16,gutter:-1' \
    <"$FZFPIPE"
) || exit 1

Thanks!