Skip to content

Commit

Permalink
Add per-dimensionality defaults #13
Browse files Browse the repository at this point in the history
  • Loading branch information
deanishe committed Jul 16, 2017
1 parent f41d5a8 commit 74f9c9b
Show file tree
Hide file tree
Showing 8 changed files with 2,071 additions and 383 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.cache

# Python snippets from gitignore on github

*.py[co]
Expand Down
72 changes: 60 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ Convert between different units offline in [Alfred 2 & 3][alfred].

![][demo]

Alfred-Convert uses a [built-in library][pintdocs] for lightning fast conversions.
Alfred-Convert uses a [built-in library][pintdocs] for lightning-fast conversions.

You can also add your own custom units.

**Note:** Currency conversions do require occasional Internet connectivity to update exchange rates. Alfred-Convert will otherwise work just fine without an Internet connection.

- [Downloading](#downloading)
- [Usage](#usage)
- [Conversions](#conversions)
- [Configuration](#configuration)
- [Active currencies](#active-currencies)
- [Custom units](#custom-units)
- [Supported units](#supported-units)
- [Supported currencies](#supported-currencies)
- [Adding custom units](#adding-custom-units)
Expand All @@ -24,16 +28,35 @@ You can also add your own custom units.
Downloading
-----------

Download from [GitHub][ghreleases] or [Packal.org][packal].
Download from [GitHub releases][ghreleases].

**Note**: Version 3.0 and above only supports Alfred 3. If you're still using Alfred 2, please download [v2.6][v2.6].


Usage
-----

- `conv <quantity> <from unit> [<to unit>]` — Perform a conversion
- `` or `⌘C` — Copy the result to the pasteboard
- `⌘↩` — Add/remove destination unit as default for this dimensionality
- `⌘L` — Show result in Alfred's Large Type window
- `convinfo` — View help file and information about the workflow, or edit custom units and active currencies
- `View Help File` — Open this page in your browser
- `View All Supported Currencies` — View/filter the list of all supported currencies in Alfred
- `Edit Active Currencies` — Edit the list of active currencies in your default text editor
- `Edit Custom Units` — Edit the list of custom currencies in your default text editor


### Conversions ###

The syntax is simple: the quantity, the unit you want to convert from then the unit you want to convert to. For example:
- `conv <quantity> <from unit> [<to unit>]` — Perform a conversion
- `` or `⌘C` — Copy the result to the pasteboard
- `⌘↩` — Add/remove destination unit as default for this dimensionality
- `⌘L` — Show result in Alfred's Large Type window

If no destination unit is specified, any defaults you've saved will be used (that aren't the same as the source unit).

The syntax is simple: the quantity, the unit you want to convert from then (optionally) the unit you want to convert to. For example:

- `conv 128 mph kph`
- `conv 72in cm`
Expand All @@ -46,13 +69,38 @@ It doesn't matter if there is a space between the quantity and the units or not.
Actioning an item (selecting it and hitting ``) will copy it to the clipboard. Using `⌘+L` will display the result in Alfred's large text window, `⌘+C` will copy the selected result to the clipboard.


### Settings ###
### Configuration ###

The workflow is configured via the configuration sheet (`[𝓍]`) in Alfred Preferences and via a couple of text files in its data directory.


#### Configuration sheet ####

Basic configuration is performed in the configuration sheet:

| Option | Meaning |
|-----------------------|----------------------------------------------------------------------------------------------|
| `COPY_UNIT` | Include unit when copying conversion result. Any value but `0` or empty turns this option on |
| `DECIMAL_PLACES` | Number of decimal places to show in results |
| `DECIMAL_SEPARATOR` | Character to separate whole numbers and decimal fractions |
| `THOUSANDS_SEPARATOR` | Character to delimit thousands |
| `UPDATE_INTERVAL` | How often (in minutes) to update currency exchange rates |


#### Active currencies ####

By default, all supported fiat currencies and a handful of the most popular cryptocurrencies are active.

- `convinfo`
- `View All Supported Currencies`
- `Edit Active Currencies`

Use `Edit Active Currencies` to open the list of active currencies in your default editor. Add the symbol for the currency you'd like to activate on a new line in this file.

Use `convinfo` to view the built-in help file, view/search the list of
supported currencies, change the number of decimal places shown in conversions, or edit your custom units.
You can use `View All Supported Currencies` to search for the currency you'd like to activate, then use `⌘C` on the result to copy the symbol to the pasteboard.


### Custom units ###
#### Custom units ####

See [Adding custom units](#adding-custom-units).

Expand All @@ -62,14 +110,14 @@ Supported units

Currently, Alfred-Convert only supports [the units][pintunits] understood by the underlying [Pint][pintdocs] library plus [currencies](#supported-currencies) and a handful of additional units.

You can [your own custom units](#adding-custom-units) to the workflow. If you think they'd be useful to everyone, please create a corresponding [GitHub issue][ghissues] to request addition as a default unit or submit a [pull request][ghpulls].
You can [add your own custom units](#adding-custom-units) to the workflow. If you think they'd be useful to everyone, please create a corresponding [GitHub issue][ghissues] to request addition as a default unit or submit a [pull request][ghpulls].


### Supported currencies ###

To convert, use the appropriate **abbreviation** for the relevant currencies, e.g. `conv 100 eur gbp`.

You can also view (and search) the list from within Alfred by using the keyword `convinfo` and choosing `View Supported Currencies`.
You can also view (and search) the list from within Alfred by using the keyword `convinfo` and choosing `View All Supported Currencies`.

[All supported currencies](./docs/currencies.md).

Expand All @@ -90,7 +138,7 @@ See [CHANGELOG][changelog] for more information.

| Release | Date |
|-------------|----------------|
| [3.0][v3.0] | |
| [3.0][v3.0] | 2017-07-16 |
| [2.6][v2.6] | 2017-06-15 |
| [2.5][v2.5] | 2015-12-11 |
| [2.4][v2.4] | 2015-11-28 |
Expand All @@ -110,7 +158,7 @@ Thanks, copyright, licensing
- Exchange rates are downloaded from [Yahoo! Finance][yahoo-finance] and [CryptoCompare][cryptocompare] (for cryptocurrencies).
- The [Alfred-Workflow][alfred-workflow] library is used heavily.

All other code/media are released under the [MIT Licence](http://opensource.org/licenses/MIT).
All other code/media are released under the [MIT Licence][mit].


[alfred-workflow]: http://www.deanishe.net/alfred-workflow/
Expand All @@ -121,7 +169,7 @@ All other code/media are released under the [MIT Licence](http://opensource.org/
[ghissues]: https://github.com/deanishe/alfred-convert/issues
[ghpulls]: https://github.com/deanishe/alfred-convert/pulls
[ghreleases]: https://github.com/deanishe/alfred-convert/releases
[packal]: http://www.packal.org/workflow/convert
[mit]: http://opensource.org/licenses/MIT
[pintdocs]: http://pint.readthedocs.org/en/latest/index.html
[pinthowto]: http://pint.readthedocs.org/en/latest/defining.html
[pintrepo]: https://github.com/hgrecco/pint
Expand Down
Loading

0 comments on commit 74f9c9b

Please # to comment.