myrmidon
myrmidon copied to clipboard
Add support for dmenu
Since rofi is compatible with dmenu, it'd be nice to be able to choose the executable being used for passing the options.
I think one of the first questions to answer is how you want the task selector to be configured.
I suggest adding a configuration file separate from the task lists.
{
"exec": "dmenu -i -l 10 -p \"Search tasks\"",
"confirm": "dmenu -i -l 10 -p \"$message \""
}
This allows configuration of the task selector, including some control of the prompts. However, I think full configuration of the texts would be a separate issue (i18n).
The benefit of having this configuration separate from tasks is that it can be reused with multiple task lists, without having to add the configuration to multiple files. It could also be mixed and matched.
This would require adding support for named parameters to the myrmidon script. It would also require the myrmidon script to pass configuration to the confirm script.
myrmidon.sh -c config.rofi.json -t tasks.json
myrmidon.sh --config config.dmenu.json --tasks tasks.json
Having the configuration separate does sound like a good idea. In fact I'd say most of the time the configuration would be static, and as such, could live in the home directory (say, .myrmidon or .config/myrmidon/config, with an option to specify the config file)
I'm not familiar of what it takes to be able to parse named parameters within a bash script though, but I'm assuming it would need further dependencies to work.
I like what you're saying though, essentially myrmidon just pipes the tasks and takes care of the selection of said tasks, therefore, commands may be switched at any given time if there's a need by the user, at the cost of having a bit more fragility in terms of the main functionality. For example, you could easily forget to add fuzzy searching to your command.
I'm not sure whether the format should be json for this, although i'm wary to add additional dependencies just for the sake of it.
i18n could be handled with additional options in this same file.
I'm looking forward to working on this. I've started on it and added a draft pull request with what I have so far.
Thank you! sorry about not reviewing this earlier. Looks pretty good so far! I made a few comments on the PR.