A calculator for Rofi/dmenu(2)
sudo make install
This repository is a Nix flake. You can add this repo as an input to your Nix flake.
inputs.menucalc.url = "github:sumnerevans/menu-calc";
If you want to follow your own nixpkgs version:
inputs.menucalc = {
url = "github:sumnerevans/menu-calc";
inputs.nixpkgs.follows = "nixpkgs";
};
And then use it like:
outputs = { ..., menucalc }: {
...
menucalc.packages.x86_64-linux.menucalc
...
};
menu-calc
uses bc
as the backend and will accept any operations bc
is able
to do:
= -h
= 4 4
= (4 2)/(4 3)
= 4^2
= sqrt(4)
= c(2)
The answer can be copied to the clipboard and used for further calculations inside (or outside) Rofi/dmenu.
If launched outside of Rofi/dmenu the expression may need quotation marks.
To launch directly into the calculator, use the following command (useful if bound to "super equal" in sxhkd, i3 or the like):
= -- [rofi/dmenu parameters]
For example:
= -- -location 2 -width 100
By default, if rofi
is installed, it will be used. You can force menu-calc
to use dmenu
or any other dmenu
-like application:
= --dmenu=dmenu