unit-converter-albert-ext
Extension for converting units of length, mass, speed, temperature, time, current, luminosity, printing measurements, molecular substance, in Albert launcher
Installation
- Locate the
modules
directory in the Python extension data directory.
The data directories reside in the data directories of the application defined by Qt. Hence on Linux the modules would be looked up in the following directories (in this order):
~/.local/share/albert/org.albert.extension.python/modules
/usr/local/share/albert/org.albert.extension.python/modules
/usr/share/albert/org.albert.extension.python/modules
(Note: Double-clicking on a module in the settings will open the directory in the file manager.)
- Clone this repository into your
modules
directory.
cd /path/to/modules
git clone https://github.com/DenverCoder1/unit-converter-albert-ext.git
- Ensure that
pint
andinflect
are installed using pip.
python3 -m pip install -U pint
python3 -m pip install -U inflect
- Enable the extension in the settings under
Extensions > Python
.
Usage
Type an amount and unit, followed by the word "to" or "in" and then the unit you want to convert to.
Examples:
180 minutes to hrs
100 km in miles
88 mph in kph
32 degrees F to C
3.14159 rad to degrees
Configuration
In config.jsonc
there are options to customize the extension:
Aliases
To add an alias for a unit, add a key-value pair to the aliases
object.
Example: "sec": "second"
allows you to type sec
instead of second
.
Many aliases are already supported.
Display Names
If the display name of a unit seems strange, you can override it by adding a key-value pair to the display_names
object.
Example: "degree_Celsiuses": "°C"
will make the displayed result appear as 32 °C
instead of 32 degree_Celsiuses
.
Contributing
If you have any questions, suggestions, or issues, please feel free to open an issue or pull request.
Support