Skip to content

A gnome extension that is a text-based calculator that lives on the gnome panel (top bar), out of the way of your work.

Notifications You must be signed in to change notification settings

mgeck64/pcalc-mgeck64.github.com

Repository files navigation

pcalc

A text-based calculator that lives on the gnome panel (top bar), out of the way of your work.

In it's default configuration, the calculator provides a text entry field on the panel into which a mathematical expression can be entered for evaluation; the calculator also provides an icon next to the entry field that can be pressed (clicked) to present a popup that has a larger entry field and help information.

The calculator can be configured to disable the entry field on the panel so that only the icon appears there; pressing (clicking) the icon presents the popup having the larger entry field.

The calculator can also be configured to not show help information on the popup, in which case the popup will have the larger entry field by itself.

Basic guide for expressions

An example of an expression is 2+4*8, which means multiply 4 by 8 and add 2 to the result.

Supported operators:
    + for addition
    - for subtraction and negation
    * for multiplication
    / for division
    ^ or ** for exponentiation (right-associative)

Use parentheses to override operator precedence; e.g., (2+4)*8 means add 2 to 4 and multiply the result by 8.

Numbers can have a 0b, 0o or 0x prefix, or can be specified in scientific E notation; e.g., 0b11011001, 0o331, 0xd9 and 2.17e+2 all specify the number 217.

The following special values and functions are available:
    pi : Did you know that March 14 is Pi day?
    e : Euler's number
    last : The last calculated value
    abs(x) : Absolute value of x
    acos(x) : Arccosine of x, in radians
    acosh(x) : Hyperbolic arccosine of x
    asin(x) : Arcsine of x, in radians
    asinh(x) : Hyperbolic arcsine of x
    atan(x) : Arctangent of x between -pi and pi radians
    atan2(y, x) : Arctangent of the quotient of its arguments
    atanh(x) : Hyperbolic arctangent of x
    cbrt(x) : Cubic root of x
    ceil(x) : x rounded upwards to the nearest integer
    cos(x) : Cosine of x (x is in radians)
    cosh(x) : Hyperbolic cosine of x
    exp(x) : Value of e raised to the power of x
    floor(x) : x rounded downwards to the nearest integer
    ln(x) or log(x) : Natural logarithm (base e) of x
    random() : Random number between 0 and 1
    round(x) : Rounds x to the nearest integer
    sin(x) : Sine of x (x is in radians)
    sinh(x) : Hyperbolic sine of x
    sqrt(x) : Square root of x
    tan(x) : Tangent of an angle
    tanh(x) : Hyperbolic tangent of a number
    trunc(x) : Integer part of a number x

Manual installation notes

  • Run make (or make all) from the project folder to compile the schema
  • Place the folder in ~/.local/share/gnome-shell/extensions
  • Rename the folder to pcalc@mgeck64.github.com so the gnome shell will find it
  • Makefile, .gitignore and this file can be deleted (optional)
  • Reset the gnome shell (if under X11 then press Alt-F2 and then submit the r command; else if under Wayland then log out and log back in)

About

A gnome extension that is a text-based calculator that lives on the gnome panel (top bar), out of the way of your work.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published