A dead-simple, tiny task executor for Rofi.
Myrmidon executes tasks for you, displaying something similar to modern text editor's command palette. You define the task names and commands, and let Myrmidon make a fuzzy search list to select and execute tasks.
I've been looking for something like this for a while since I started using i3. Sometimes not everything merits yet another keybinding to remember, nor a bunch of shell files laying around.
Myrmidon currently depends on:
Copy the shell script in a directory included in your PATH
(e.g: ~/bin
)
Define your tasks in a json file. The default location of the json file will be $HOME/.myrmidon-tasks.json
, but you can pass an optional argument as a custom path for the configuration file (e.g: ./myrmidon.sh ~/my-custom-path/tasks.json
).
Each task is comprised of a name
, command
and whether or not it needs a confirmation screen (confirm
).
confirm
can either be just true
if you only want to use the default, or you can customize it with an object.
Example:
[
{
"name": "Area screenshot",
"command": "gnome-screenshot -a"
},
{
"name": "Window screenshot",
"command": "gnome-screenshot -w"
},
{
"name": "Power off",
"confirm": {
"message": "Do you really want to shut down ?"
},
"command": "systemctl poweroff"
},
{
"name": "Reboot",
"confirm": true,
"command": "systemctl reboot"
},
{
"name": "Suspend",
"confirm": {
"invert": true,
"yes": "Yep",
"no": "Nope"
},
"command": "systemctl suspend"
}
]
After configuring your tasks file, you would have to set up a keybinding, if needed, to make it work.
For example, in i3
:
bindsym $mod+p exec --no-startup-id ~/bin/myrmidon.sh
As it is possible to provide an optional location of the config file, you can keep multiple keys for different task "categories", for example:
bindsym $mod+p exec --no-startup-id ~/bin/myrmidon.sh ~/common-tasks.json
bindsym $mod+Esc exec --no-startup-id ~/bin/myrmidon.sh ~/power-tasks.json
bindsym $mod+Print exec --no-startup-id ~/bin/myrmidon.sh ~/screenshot-tasks.json
This way, for example, $mod+Esc will now only show tasks related to power (Power off, restart, suspend, etc), as to not pollute the task pool.
If you feel there's any missing feature you'd like to see in Myrmidon, feel free to propose it or open a pull request!