Skip to content

Commit 74f9c9b

Browse files
committed
Add per-dimensionality defaults #13
1 parent f41d5a8 commit 74f9c9b

8 files changed

+2071
-383
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.cache
2+
13
# Python snippets from gitignore on github
24

35
*.py[co]

README.md

+60-12
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@ Convert between different units offline in [Alfred 2 & 3][alfred].
66

77
![][demo]
88

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

1111
You can also add your own custom units.
1212

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

1515
- [Downloading](#downloading)
1616
- [Usage](#usage)
17+
- [Conversions](#conversions)
18+
- [Configuration](#configuration)
19+
- [Active currencies](#active-currencies)
20+
- [Custom units](#custom-units)
1721
- [Supported units](#supported-units)
1822
- [Supported currencies](#supported-currencies)
1923
- [Adding custom units](#adding-custom-units)
@@ -24,16 +28,35 @@ You can also add your own custom units.
2428
Downloading
2529
-----------
2630

27-
Download from [GitHub][ghreleases] or [Packal.org][packal].
31+
Download from [GitHub releases][ghreleases].
32+
33+
**Note**: Version 3.0 and above only supports Alfred 3. If you're still using Alfred 2, please download [v2.6][v2.6].
2834

2935

3036
Usage
3137
-----
3238

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

3450
### Conversions ###
3551

36-
The syntax is simple: the quantity, the unit you want to convert from then the unit you want to convert to. For example:
52+
- `conv <quantity> <from unit> [<to unit>]` — Perform a conversion
53+
- `` or `⌘C` — Copy the result to the pasteboard
54+
- `⌘↩` — Add/remove destination unit as default for this dimensionality
55+
- `⌘L` — Show result in Alfred's Large Type window
56+
57+
If no destination unit is specified, any defaults you've saved will be used (that aren't the same as the source unit).
58+
59+
The syntax is simple: the quantity, the unit you want to convert from then (optionally) the unit you want to convert to. For example:
3760

3861
- `conv 128 mph kph`
3962
- `conv 72in cm`
@@ -46,13 +69,38 @@ It doesn't matter if there is a space between the quantity and the units or not.
4669
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.
4770

4871

49-
### Settings ###
72+
### Configuration ###
73+
74+
The workflow is configured via the configuration sheet (`[𝓍]`) in Alfred Preferences and via a couple of text files in its data directory.
75+
76+
77+
#### Configuration sheet ####
78+
79+
Basic configuration is performed in the configuration sheet:
80+
81+
| Option | Meaning |
82+
|-----------------------|----------------------------------------------------------------------------------------------|
83+
| `COPY_UNIT` | Include unit when copying conversion result. Any value but `0` or empty turns this option on |
84+
| `DECIMAL_PLACES` | Number of decimal places to show in results |
85+
| `DECIMAL_SEPARATOR` | Character to separate whole numbers and decimal fractions |
86+
| `THOUSANDS_SEPARATOR` | Character to delimit thousands |
87+
| `UPDATE_INTERVAL` | How often (in minutes) to update currency exchange rates |
88+
89+
90+
#### Active currencies ####
91+
92+
By default, all supported fiat currencies and a handful of the most popular cryptocurrencies are active.
93+
94+
- `convinfo`
95+
- `View All Supported Currencies`
96+
- `Edit Active Currencies`
97+
98+
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.
5099

51-
Use `convinfo` to view the built-in help file, view/search the list of
52-
supported currencies, change the number of decimal places shown in conversions, or edit your custom units.
100+
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.
53101

54102

55-
### Custom units ###
103+
#### Custom units ####
56104

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

@@ -62,14 +110,14 @@ Supported units
62110

63111
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.
64112

65-
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].
113+
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].
66114

67115

68116
### Supported currencies ###
69117

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

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

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

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

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

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

115163

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

0 commit comments

Comments
 (0)