Skip to content
This repository has been archived by the owner on Jan 26, 2023. It is now read-only.

Albert launcher extension for converting units of length, mass, speed, temperature, time, current, luminosity, printing measurements, molecular substance, and more

License

Notifications You must be signed in to change notification settings

DenverCoder1/unit-converter-albert-ext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Archive Notice

This repo is no longer needed since this extension is now merged into the upstream Python plugin repo.

unit-converter-albert-ext

discord License MIT code style black

Extension for converting units of length, mass, speed, temperature, time, current, luminosity, printing measurements, molecular substance, currency, and more in Albert launcher

demo 0.18

Installation

  1. Locate the plugins 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/python/plugins
/usr/local/share/albert/python/plugins
/usr/share/albert/python/plugins
  1. Clone this repository into your plugins directory.
cd /path/to/plugins  # see above for the path

git clone https://github.com/DenverCoder1/unit-converter-albert-ext.git
  1. Ensure that pint and inflect are installed in ~/.local/share/albert/python/site-packages.
cd unit-converter-albert-ext

pip install -U -r requirements.txt -t ~/.local/share/albert/python/site-packages
  1. Enable the extension in the settings under the Plugins tab.

open settings

enable plugin

Usage

Type the trigger, followed by the amount and unit, the word "to" or "in", and then the unit you want to convert to.

<trigger> <amount> <from_unit> {to|in} <to_unit>

Examples:

convert 180 minutes to hrs

convert 100 km to miles

convert 88 mph to kph

convert 32 degrees F to C

convert 3.14159 rad to degrees

convert 100 EUR to USD

To configure the trigger to be something other than "convert ", open the Triggers tab in the Albert settings.

configure trigger

Configuration

In config.jsonc there are options to customize the behavior of the extension:

Rounding Precision

The rounding_precision option controls how many decimal places the result will be rounded to. By default, this is 3.

The rounding_precision_zero option controls how many decimal places the result will be rounded to when the result is close to zero. By default, this is 12.

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

💙 If you like this project, give it a ⭐ and share it with friends!

Youtube Sponsor with Github

☕ Buy me a coffee

About

Albert launcher extension for converting units of length, mass, speed, temperature, time, current, luminosity, printing measurements, molecular substance, and more

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Languages