All Projects â†’ svenstaro â†’ Rofi Calc

svenstaro / Rofi Calc

Licence: mit
🖩 Do live calculations in rofi!

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Rofi Calc

menu-calc
A calculator for Rofi/dmenu(2)
Stars: ✭ 45 (-89.98%)
Mutual labels:  calculator, rofi
Nasc
Do maths like a normal person
Stars: ✭ 396 (-11.8%)
Mutual labels:  calculator
Num-Plus-Plus
A scientific & intutive calculator written in Flutter.
Stars: ✭ 62 (-86.19%)
Mutual labels:  calculator
Uistackviewplayground
Playground to play with UIStackViews.
Stars: ✭ 319 (-28.95%)
Mutual labels:  calculator
Micromathematics
microMathematics Plus - Extended visual calculator
Stars: ✭ 263 (-41.43%)
Mutual labels:  calculator
Bcal
đŸ”ĸ Storage and general-purpose calculator
Stars: ✭ 329 (-26.73%)
Mutual labels:  calculator
BDO Enhancement Tool
Open source tool for planning fail stacks and enhancement priority in Black Desert Online
Stars: ✭ 25 (-94.43%)
Mutual labels:  calculator
Awesome Dotfiles
Dotfiles for awesome people using the awesomewm linux environment
Stars: ✭ 409 (-8.91%)
Mutual labels:  rofi
Firebird
Third-party multi-platform emulator of the ARM-based TI-Nspire calculators
Stars: ✭ 374 (-16.7%)
Mutual labels:  calculator
Algebraicengine Fraction
a calculating engine~
Stars: ✭ 311 (-30.73%)
Mutual labels:  calculator
Calculatex
in progress pretty printing calculator language
Stars: ✭ 302 (-32.74%)
Mutual labels:  calculator
Arknights Toolbox
🔨 Arknights Toolbox, all servers are supported. 明æ—Ĩæ–ščˆŸåˇĨå…ˇįŽąīŧŒæ”¯æŒä¸­å°įžŽæ—Ĩ韊服
Stars: ✭ 271 (-39.64%)
Mutual labels:  calculator
Dmenu Extended
An extension to dmenu for quickly opening files and folders.
Stars: ✭ 334 (-25.61%)
Mutual labels:  rofi
Amazing Python Scripts
🚀 Curated collection of Amazing Python scripts from Basics to Advance with automation task scripts.
Stars: ✭ 229 (-49%)
Mutual labels:  calculator
Eva
a calculator REPL, similar to bc(1)
Stars: ✭ 405 (-9.8%)
Mutual labels:  calculator
dotfiles
My dotfiles
Stars: ✭ 16 (-96.44%)
Mutual labels:  rofi
Clac
Command-line, stack-based calculator with postfix notation
Stars: ✭ 306 (-31.85%)
Mutual labels:  calculator
Rofimoji
An emoji and character picker for rofi 😁
Stars: ✭ 319 (-28.95%)
Mutual labels:  rofi
Archcraft
// Source : ISO
Stars: ✭ 437 (-2.67%)
Mutual labels:  rofi
Networkmanager Dmenu
Control NetworkManager via dmenu
Stars: ✭ 405 (-9.8%)
Mutual labels:  rofi

rofi-calc

🖩 Do live calculations in rofi!

GitHub Actions Workflow license Stars

A rofi plugin that uses qalculate's qalc to parse natural language input and provide results.

Since this uses qalculate's amazing qalc you can try natural language queries such 500 + 25% or 5000 EUR to USD or 150 to hex. It can also solve linear equations on the fly. Try 60x + 30 = 50, for instance.

Run rofi like:

rofi -show calc -modi calc -no-show-match -no-sort

The result of the current input can be selected with Ctrl+Enter, and history entries can be selected with Enter. By default this will just output the equation/result.

The history file by default sits at $HOME/.local/share/rofi/rofi_calc_history in case you ever need to delete it or change it manually. You can disable persistent history if you don't like that.

Installation

Packaging status

Via package manager

From source

You need a C compilation toolchain (a cc, autoconf, pkg-config, ...), rofi (version >= 1.5) as well as qalculate (version > 2.0).

You will also need development headers for rofi. Depending on your distribution these may be included in different packages:

  • Arch Linux, Gentoo: included with rofi, libqalculate
  • OpenSUSE: zypper in rofi rofi-devel qalculate
  • Debian: dpkg --install rofi-dev qalc libtool
  • Ubuntu: apt install rofi-dev qalc libtool
  • Solus: eopkg it rofi-devel libqalculate
  • CentOS, Fedora: Install qalculate (find rofi-devel headers yourself)
  • Others: look it up :)

Some distributions ship an extremely outdated version of qalculate so you might have to compile your own. If that is the case, see here.

rofi-calc uses autotools as build system. If installing from git, the following steps should install it:

$ autoreconf -i
$ mkdir build
$ cd build/
$ ../configure
$ make
$ make install

Advanced Usage

  • Use the -qalc-binary option to specify the name or location of qalculate's qalc binary. Defaults to qalc.

  • Use the -terse option to reduce the output of qalc to just the result of the input expression.

  • Use the -no-unicode option to disable qalc's Unicode mode.

  • Use the -calc-command option to specify a shell command to execute which will be interpolated with the following keys:

    • {expression}: the left-side of the equation (currently not available when using -terse)
    • {result}: the right of the equation

    The following example copies the result to the clipboard upon pressing the key combination defined by -kb-accept-custom (by default Control+Return). NOTE: {result} should be quoted since it may contain characters that your shell would otherwise interpret:

      rofi -show calc -modi calc -no-show-match -no-sort -calc-command "echo -n '{result}' | xclip"
    
  • It's convenient to bind it to a key combination in i3. For instance, you could use:

      bindsym $mod+c exec --no-startup-id "rofi -show calc -modi calc -no-show-match -no-sort > /dev/null"
    
  • To disable the bold font applied to the results by default, you can use the flag -no-bold and run rofi like:

      rofi -show calc -modi calc -no-show-match -no-sort -no-bold
    
  • To disable persistent history, use -no-persist-history:

      rofi -show calc -modi calc -no-show-match -no-sort -no-persist-history
    

    This will disable writing and loading the history file and thus you'll lose and entered entries upon quitting rofi-calc.

  • To disable the history entirely, use -no-history:

      rofi -show calc -modi calc -no-show-match -no-sort -no-history -lines 0
    

    The benefit of this is that you can simply enter a term and press return and that'll already act on the result by printing it to stdout or via -calc-command if configured.

  • To enable thousand separators in the output (e.g. 5 * 12 = 6,000, rather than 6000) add the following to ~/.config/qalculate/qalc.cfg

    • For , separator:

        digit_grouping=2
      
    • For space separator:

        digit_grouping=1
      
  • To use a different output format for numeric representations (for instance, some locales use , instead of . as a decimal separator), set LC_NUMERIC to a different value like this:

      LC_NUMERIC=de_DE.UTF-8 rofi -show calc -modi calc -no-show-match -no-sort
    
  • To set a different default locale, set your LC_MONETARY variable:

      LC_MONETARY=de_DE.UTF-8 rofi -show calc -modi calc -no-show-match -no-sort
    

    Make sure the locale is actually available on your system!

  • Use the -hint-result option to specify the text of the hint before result.

  • Use the -hint-welcome option to specify the welcome text.

Development

If you're developing this, it might be helpful to start rofi directly with a locally compiled plugin like this:

rofi -plugin-path build/.libs -show calc -modi calc -no-show-match -no-sort
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].