kickoff icon indicating copy to clipboard operation
kickoff copied to clipboard

Limit list of apps

Open cain-dev opened this issue 3 years ago • 20 comments

Hi, i was testing your launcher with a very slow computer, very fast indeed, the only problem i have right now is that i can't find apps easily like wofi, shows everything and i didn't found the option to change that, is it possible to limit that and (even better) to list exactly the list of apps to show?

thanks

cain-dev avatar May 02 '22 06:05 cain-dev

Hi, thanks for the interest! There are no options like that at the moment, but I intend to implement the possibility to read a list from stdin instead of searching the whole path. Would that work for you?

j0ru avatar May 04 '22 15:05 j0ru

Anything with dotfiles and documentation with some examples is enough for me. From a list of terminal commands on a file to a file with a list of paths to .desktop files, but the best option for me would be a list of commands do launch programs but with a user defined title, something like:

config.toml:

Program list:

"program title"="program command" "Firefox browser"="firefox" "Retroarch"="flatpak run org.libretro.RetroArch"

Just an ideia, sorry if im bothering xD

cain-dev avatar May 04 '22 15:05 cain-dev

Just pitching in, would a deny-list regex work? You could then specify a regex and if it matches an entry is hidden. That would be easier then listing all your flatpaks for example.

Taking this further a default regex could be provided to filter out common noise

yara-blue avatar May 04 '22 17:05 yara-blue

Just pitching in, would a deny-list regex work? You could then specify a regex and if it matches an entry is hidden. That would be easier then listing all your flatpaks for example.

Taking this further a default regex could be provided to filter out common noise

Honestly i don't think so, at least not for me. A list to execute things and control what shows is way more intuitive.

cain-dev avatar May 04 '22 20:05 cain-dev

The Idea with the program list sounds interesting, since it allows to hide the actual commands being run. Maybe something like this:

[[selections.foo]]
"Firefox" = "firefox -P personal"
"Firefox Work" = "firefox -P work"
"Calculator" = "foot ipython" # foot is my terminal

[[selections.bar]]
"Bar" = "baz"

and then being able to launch different selections like this kickoff --selection foo.

Another possibility would be to have some logic behind reading stdin:

$ cat program_list

Firefox="firefox -P personal"
"Firefox Work"="firefox -p work"

$ cat program_list | kickoff --stdin

In combination with a --stdout flag, this could allow for a bit more komplex stuff, like seleting an ssh server to connect to:

foot ssh $(some_ssh_config_parser | kickoff --stdin --stdout)

j0ru avatar May 05 '22 10:05 j0ru

I have implemented a very rudimentary version of stdin parsing in #27 Currently it is only split by the '=' sign, but that won't hold up to setting env variables in the command. Some logic evaluating quotes is still needed, but it's enough to try it out. I'd be happy to receive some feedback!

j0ru avatar May 09 '22 17:05 j0ru

Ok, i will try. Sorry about the delay.

how is the syntax for the list?

cain-dev avatar May 25 '22 17:05 cain-dev

Two forms are supported, either a single value or an alias:

foo --bar
foo="bar --baz"

j0ru avatar May 30 '22 12:05 j0ru

do i have to put something before this lines? [selections] [program_list] or something like that? sorry if it is a dumb question but...

[keybindings] paste = ["ctrl+v"] execute = ["KP_Enter", "Return"] delete = ["KP_Delete", "Delete", "BackSpace"] delete_word = ["ctrl+KP_Delete", "ctrl+Delete", "ctrl+BackSpace"] complete = ["Tab"] nav_up = ["Up"] nav_down = ["Down"] exit = ["Escape"]

Firefox="firefox" Terminal="foot"

is not working.

cain-dev avatar May 30 '22 16:05 cain-dev

Oh, at the moment it's only possible to pass in stuff via stdin. You could do something like:

cat program_list | kickoff --stdin --path

That will read your program list from stdin and path

j0ru avatar May 30 '22 16:05 j0ru

sorry, im a noob but i've made a file with this lines:

Firefox="firefox" Terminal="foot"

and have used the command

cat .config/kickoff/program_list | kickoff --stdin

and it didn't work for me x.x

haaalp

cain-dev avatar May 30 '22 17:05 cain-dev

As far as I can see you have done nothing wrong...

Have you checked out the linked PR or did you build from main?

Btw, nothing wrong with beginning to learn new stuff, I'm glad to help

j0ru avatar May 30 '22 17:05 j0ru

yay -S kickoff =D

version 0.5.0-1

cain-dev avatar May 30 '22 17:05 cain-dev

Oh okay, that explains it xD

I haven't pulled the feature into main yet, because it might still change.

You can test it by cloning the repo an checking out the branch like so:

git clone https://github.com/j0ru/kickoff.git
git checkout feature/stdin-and-stdout
cargo build --release

And the executing it with

target/release/kickoff

j0ru avatar May 30 '22 17:05 j0ru

tried and it worked, but i have something to add

I have tested a random command just to see what happens and if the command don't work the kickoff layer just stays frozen on the screen.

this option to read AS stdin is amazing, but i will ask you to consider a $HOME/.config/kickoff/program_list file as option. maybe on the future with the option to order things "as is"

cain-dev avatar May 30 '22 18:05 cain-dev

What exactly do you mean with as is? Alphabetical or the options from the config and stdin on top like they are defined in the config?

Btw, thanks for the awesome feedback and thanks for testing!

j0ru avatar May 30 '22 19:05 j0ru

as is in the same way of just "cat filename | kickoff", this would give the option to have different program lists with different orders, like:

default_programs_list.txt with: order=as-is browser="firefox" terminal="foot"

shows: browser terminal

games_list.txt with:

order=alphabetic GameB="gameB" GameA="gameA" GameC="gameC"

shows:

GameA GameB GameC

just giving some ideas xD

cain-dev avatar May 30 '22 20:05 cain-dev

Alrighty, I'll have another look at it tomorrow, currently a student party clouds my mind :D

j0ru avatar May 30 '22 21:05 j0ru

take your time bro, and stay safe o/

cain-dev avatar May 30 '22 21:05 cain-dev

Alright, had a bit of time today and implemented the reading from a file. I probably won't implement the sorting, because it is irrelevant as soon as you type anything, but I did ensure that elements from stdin and file stay in order till the first search happens.

There is still a bit of error catching to do, but the functionality is there

j0ru avatar Jun 04 '22 22:06 j0ru