1
0
mirror of https://github.com/Toxblh/MTMR.git synced 2026-01-11 17:38:38 +00:00

upd from release

This commit is contained in:
Toxblh 2018-04-12 10:46:15 +01:00
parent 81131ec390
commit 080bc67c54

View File

@ -50,43 +50,8 @@ Maybe:
File for setting your preset for MTMR: `open ~/Library/Application Support/MTMR/items.json` File for setting your preset for MTMR: `open ~/Library/Application Support/MTMR/items.json`
## Base types ## Built-in button types:
- `staticButton`
```json
"type": "staticButton",
"title": "esc",
```
- `staticImageButton`
```json
"type": "staticImageButton",
"image": "StringInbase64"
"title": "Finder",
```
- `appleScriptTitledButton`
```js
"type": "appleScriptTitledButton",
"source": {
"filePath": "/Users/toxblh/Library/Application Support/MTMR/iTunes.nowPlaying.scpt",
// or
"inline": "tell application \"Finder\"\rmake new Finder window\rset target of front window to path to home folder as string\ractivate\rend tell",
// or
"base64": "StringInbase64"
},
```
- `timeButton`
```json
"type": "timeButton",
```
- `flexSpace` - special type for insert the flexible space between buttons
```json
"type": "flexSpace"
```
## Preconfig types
- escape - escape
- exitTouchbar - exitTouchbar
- brightnessUp - brightnessUp
@ -105,6 +70,44 @@ File for setting your preset for MTMR: `open ~/Library/Application Support/MTMR/
- sleep - sleep
- displaySleep - displaySleep
### You can also make a custom buttons using these types
- `staticButton`
```json
"type": "staticButton",
"title": "esc",
```
- `staticImageButton`
```json
"type": "staticImageButton",
"image": "StringInbase64"
"title": "Finder",
```
- `appleScriptTitledButton`
```js
"type": "appleScriptTitledButton",
"refreshInterval": 60, //optional
"source": {
"filePath": "/Users/toxblh/Library/Application Support/MTMR/iTunes.nowPlaying.scpt",
// or
"inline": "tell application \"Finder\"\rmake new Finder window\rset target of front window to path to home folder as string\ractivate\rend tell",
// or
"base64": "StringInbase64"
},
```
- `timeButton`
```js
"type": "timeButton",
"formatTemplate": "HH:mm" //optional
```
- `flexSpace` to easily split touch bar in two parts: left and right
```json
"type": "flexSpace"
```
## Actions: ## Actions:
- `hidKey` - `hidKey`
```json ```json
@ -119,10 +122,11 @@ File for setting your preset for MTMR: `open ~/Library/Application Support/MTMR/
``` ```
- `appleSctipt` - `appleSctipt`
```json ```js
"action": "appleSctipt", "action": "appleSctipt",
"actionAppleScript": { "actionAppleScript": {
"inline": "tell application \"Finder\"\rmake new Finder window\rset target of front window to path to home folder as string\ractivate\rend tell" "inline": "tell application \"Finder\"\rmake new Finder window\rset target of front window to path to home folder as string\ractivate\rend tell"
// "filePath" or "base64" will work as well
}, },
``` ```
@ -135,23 +139,12 @@ File for setting your preset for MTMR: `open ~/Library/Application Support/MTMR/
``` ```
## Additional paramaters: ## Additional paramaters:
> Now in config have a special, don't configure type: `flexSpace`
- `width` for all - `width` allow to easily restrict how much room a particular button will take
```json ```json
"width": 34 "width": 34
``` ```
- `refreshInterval` for type `appleScriptTitledButton`
```json
"refreshInterval": 1
```
- `formatTemplate` for type `timeButton`
```json
"formatTemplate": "HH:mm"
```
## Example configuration: ## Example configuration:
```json ```json
[ [