svenstaro / rofi-calc

🖩 Do live calculations in rofi!
MIT License
998 stars 32 forks source link

How to use command-line flags like `-terse` in `config.rasi`? #115

Open qadzek opened 11 months ago

qadzek commented 11 months ago

Thanks a lot for this very useful plugin.

Running the sample commands (e.g. rofi -show calc -modi calc -no-show-match -no-sort -no-bold) on the command-line works fine for me, but I was wondering if we can also use these flags in config.rasi.

For instance, the rofi-power-menu plugin allows for the following:

configuration {
  modi: [
    "combi",
    "calc",
    "filebrowser",
    "p:rofi-power-menu --choices=logout/suspend/hibernate/reboot/shutdown"
  ];
}

That plugin is just a Bash script though. Trying something similar for rofi-calc (e.g. "calc -terse") returns the error Mode calc -terse is not found.

Elmegaard commented 8 months ago

As a workaround you can just add the commands to the command-line of rofi and it should work, for example: rofi -show drun -calc-command "echo -n '{result}' | wl-copy"