j0ru/kickoff

Limit list of apps

Closed this issue · 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

j0ru commented

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?

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

dvdsk commented

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

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.

j0ru commented

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 commented

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!

Ok, i will try. Sorry about the delay.

how is the syntax for the list?

j0ru commented

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

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

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.

j0ru commented

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

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

j0ru commented

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

yay -S kickoff =D

version 0.5.0-1

j0ru commented

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

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"

j0ru commented

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!

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

j0ru commented

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

take your time bro, and stay safe o/

j0ru commented

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