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

attempted to fix readme

This commit is contained in:
jazzhpatel 2020-04-08 04:26:07 +05:30
parent 5c4fe31c75
commit 92a270f295
3 changed files with 78 additions and 104 deletions

View File

@ -76,7 +76,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
} else {
TouchBarController.shared.blacklistAppIdentifiers.append(appIdentifier)
}
AppSettings.blacklistedAppIds = TouchBarController.shared.blacklistAppIdentifiers
TouchBarController.shared.updateActiveApp()
updateIsBlockedApp()
@ -132,7 +132,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
let hapticFeedback = NSMenuItem(title: "Haptic Feedback", action: #selector(toggleHapticFeedback(_:)), keyEquivalent: "H")
hapticFeedback.state = AppSettings.hapticFeedbackState ? .on : .off
let multitouchGestures = NSMenuItem(title: "Volume/Brightness gestures", action: #selector(toggleMultitouch(_:)), keyEquivalent: "")
let multitouchGestures = NSMenuItem(title: "Swipe gestures", action: #selector(toggleMultitouch(_:)), keyEquivalent: "")
multitouchGestures.state = AppSettings.multitouchGestures ? .on : .off
let settingSeparator = NSMenuItem(title: "Settings", action: nil, keyEquivalent: "")

158
README.md
View File

@ -1,7 +1,6 @@
# My touchbar. My rules. [![GitHub release](https://img.shields.io/github/release/toxblh/MTMR.svg)](https://github.com/Toxblh/MTMR/releases) [![license](https://img.shields.io/github/license/Toxblh/MTMR.svg)](https://github.com/Toxblh/MTMR/blob/master/LICENSE) ![minimal system requirements](https://img.shields.io/badge/required-macOS%2010.12.2-blue.svg) ![travis](https://travis-ci.org/Toxblh/MTMR.svg?branch=master)
<img src="Resources/logo.png" align="right"
title="MTMR by Toxblh" width="110" height="110">
![](Resources/logo.png "MTMR by Toxblh")
_The TouchBar Customization App for your MacBook Pro_
@ -9,26 +8,11 @@ My idea is to create a platform for creating plugins to customize the TouchBar.
**Share your presets [here](https://github.com/Toxblh/MTMR-presets)**
<p align="center">
<img src="./Resources/aaaaa-acc6-17fee7572ed0.png" alt="Mackbook with touchbar" width="800">
</p>
![Mackbook with touchbar](./Resources/aaaaa-acc6-17fee7572ed0.png)
<p align="center">
<a href="https://discord.gg/CmNcDuQ"><img height="20px" src="https://camo.githubusercontent.com/88f53948f291c54736bf08f5fd7b037a848dfc62/68747470733a2f2f646973636f72646170702e636f6d2f6173736574732f30376463613830613130326434313439653937333664346231363263666636662e69636f"> Discord</a>
<a href="https://t.me/joinchat/AmVYGg8vW38c13_3MxdE_g"><img height="20px" src="https://telegram.org/img/t_logo.png" /> Telegram</a>
</p>
[![](https://camo.githubusercontent.com/88f53948f291c54736bf08f5fd7b037a848dfc62/68747470733a2f2f646973636f72646170702e636f6d2f6173736574732f30376463613830613130326434313439653937333664346231363263666636662e69636f) Discord](https://discord.gg/CmNcDuQ) [![](https://telegram.org/img/t_logo.png) Telegram](https://t.me/joinchat/AmVYGg8vW38c13_3MxdE_g)
<p align="center"><a href="https://www.paypal.me/toxblh/10" title="Donate via Paypal"><img height="36px" src="Resources/support_paypal.svg" alt="PayPal donate button" /></a>
<a href="https://www.buymeacoffee.com/toxblh" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" height="36px" ></a>
<a href="https://www.patreon.com/bePatron?u=9900748"><img height="36px" src="https://c5.patreon.com/external/logo/become_a_patron_button.png" srcset="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png 2x"></a>
<a href="https://www.producthunt.com/posts/my-touchbar-my-rules-mtmr">
<img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=my-touchbar-my-rules-mtmr&theme=light" alt="My TouchBar My Rules (MTMR)" height="36px" style="max-width:100%">
</a></p>
##Better Gestures!
the commits to the code to get that make the cursor move by sliding on the touchbar ... you know how you could slide on the space bar on your phone ... its the same thing but on the touchbar and if you press ALT, itll scroll through words and if you press SHIFT, itll select the text, like you could move through tabs, just by holding CMD+SHIFT .... and two fingers makes it go slower for precision control ... its just single finger and double finger gestures sending left and right key presses.
brooooooooooooooo
[![PayPal donate button](Resources/support_paypal.svg)](https://www.paypal.me/toxblh/10 "Donate via Paypal") [![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/toxblh) [![](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/bePatron?u=9900748) [![My TouchBar My Rules (MTMR)](https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=my-touchbar-my-rules-mtmr&theme=light)](https://www.producthunt.com/posts/my-touchbar-my-rules-mtmr)
## Installation
@ -36,23 +20,29 @@ brooooooooooooooo
- Or via Homebrew `brew cask install mtmr`
- [Dario Prski](https://medium.com/@urdigitalpulse) has written a [fantastic article on medium](https://medium.com/@urdigitalpulse/customise-your-macbook-pro-touch-bar-966998e606b5) that goes into more detail on installing MTMR
**On first install** you need to allow access for MTMR in Accessibility otherwise buttons like <kbd>Esc</kbd>, <kbd>Volume</kbd>, <kbd>Brightness</kbd> and other system keys won't work
**On first install** you need to allow access for MTMR in Accessibility otherwise buttons like
<p align="center">
<img width="450" alt="screenshot 2019-02-24 at 23 19 20" src="https://user-images.githubusercontent.com/2198153/53307057-2b078200-388c-11e9-8212-8c2b1aff0aa6.png">
</p>
<kbd>Esc</kbd>
,
<kbd>Volume</kbd>
,
<kbd>Brightness</kbd>
and other system keys won't work
![screenshot 2019-02-24 at 23 19 20](https://user-images.githubusercontent.com/2198153/53307057-2b078200-388c-11e9-8212-8c2b1aff0aa6.png)
<p align="center">
🍏→ System Preferences → Security and Privacy → tab Privacy → Accessibility → MTMR
</p>
## Examples
[MTMR presets](https://github.com/Toxblh/MTMR-presets)
<p align="center">
<img src="./Resources/Artboard.png" alt="Presets for touchbar" width="800">
</p>
![Presets for touchbar](./Resources/Artboard.png)
## Customization
@ -109,11 +99,16 @@ The pre-installed configuration contains less or more than you'll probably want,
## Gestures
By default you can enable basic gestures from application menu (status bar -> MTMR icon -> Volume/Brightness gestures):
- two finger slide: change you Volume
- three finger slide: change you Brightness
### Default Gestures
### Custom gestures
By default you can enable basic gestures from application menu (status bar -> MTMR icon -> Swipe gestures):
- **one finger slide**: Move Caret
- **two finger slide**: Move Caret with precision
- **three finger slide**: Increase/Decrease Volume
- **four finger slide**: Increase/Decrease Brightness
### Custom Gestures
You can add custom actions for two/three/four finger swipes. To do it, you need to use `swipe` type:
@ -148,7 +143,7 @@ You may create as many `swipe` objects in the preset as you want.
#### `appleScriptTitledButton`
```js
```javascript
{
"type": "appleScriptTitledButton",
"refreshInterval": 60, //optional
@ -163,12 +158,14 @@ You may create as many `swipe` objects in the preset as you want.
```
> Note: appleScriptTitledButton can change its icon. To do it, you need to do the following things:
1. Declarate dictionary of icons in `alternativeImages` field
2. Make you script return array of two values - `{"TITLE", "IMAGE_LABEL"}`
3. Make sure that your `IMAGE_LABEL` is declared in `alternativeImages` field
> 1. Declarate dictionary of icons in `alternativeImages` field
> 2. Make you script return array of two values - `{"TITLE", "IMAGE_LABEL"}`
> 3. Make sure that your `IMAGE_LABEL` is declared in `alternativeImages` field
Example:
```js
```javascript
{
"type": "appleScriptTitledButton",
"source": {
@ -190,11 +187,12 @@ Example:
```
#### `shellScriptTitledButton`
> Note: script may return also colors using escape sequences (read more here https://misc.flogisoft.com/bash/tip_colors_and_formatting)
> Only "16 Colors" mode supported atm. If background color returned, button will pick it up as own background color.
> Note: script may return also colors using escape sequences (read more here <https://misc.flogisoft.com/bash/tip_colors_and_formatting>) Only "16 Colors" mode supported atm. If background color returned, button will pick it up as own background color.
Example of "CPU load" button which also changes color based on load value.
```js
```javascript
{
"type": "shellScriptTitledButton",
"width": 80,
@ -220,7 +218,7 @@ Example of "CPU load" button which also changes color based on load value.
## Groups
```js
```javascript
{
"type": "group",
"align": "center",
@ -245,15 +243,15 @@ To close a group, use the button:
## Native plugins
#### `timeButton`
### `timeButton`
> Attention! Works not all: https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations
> Attention! Works not all: <https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations>
> formatTemplate examples: https://www.datetimeformatter.com/how-to-format-date-time-in-swift/
> formatTemplate examples: <https://www.datetimeformatter.com/how-to-format-date-time-in-swift/>
> locale examples: https://gist.github.com/jacobbubu/1836273
> locale examples: <https://gist.github.com/jacobbubu/1836273>
```js
```javascript
{
"type": "timeButton",
"formatTemplate": "dd HH:mm",
@ -262,14 +260,11 @@ To close a group, use the button:
}
```
#### `weather`
### `weather`
> Provider: https://openweathermap.org \
> Note: you need to register on https://openweathermap.org to get your API key \
> Note: you may need to wait for near 20 mins until your API key will be activated by Openweathermap \
> Note: you need to allow using "Location Services" in your Mac OS "Security & Privacy" settings for MTMR
> Provider: <https://openweathermap.org> \ Note: you need to register on <https://openweathermap.org> to get your API key \ Note: you may need to wait for near 20 mins until your API key will be activated by Openweathermap \ Note: you need to allow using "Location Services" in your Mac OS "Security & Privacy" settings for MTMR
```js
```javascript
"type": "weather",
"refreshInterval": 600, // in seconds
"units": "metric", // or imperial
@ -277,21 +272,20 @@ To close a group, use the button:
"api_key": "" // you can get the key on openweather
```
#### `yandexWeather` (experimental)
### `yandexWeather` (experimental)
> Provider: https://yandex.ru/pogoda. One click to open up weather forecast in your browser. \
> Note: you need to allow using "Location Services" in your Mac OS "Security & Privacy" settings for MTMR
> Provider: <https://yandex.ru/pogoda>. One click to open up weather forecast in your browser. \ Note: you need to allow using "Location Services" in your Mac OS "Security & Privacy" settings for MTMR
```js
```javascript
"type": "yandexWeather",
"refreshInterval": 600 // in seconds
```
#### `currency`
### `currency`
> Provider: https://coinbase.com
> Provider: <https://coinbase.com>
```js
```javascript
"type": "currency",
"refreshInterval": 600, // in seconds
"align": "right",
@ -300,9 +294,9 @@ To close a group, use the button:
"full": true // £‣1.29$
```
#### `music`
### `music`
```js
```javascript
{
"type": "music",
"align": "center",
@ -313,11 +307,11 @@ To close a group, use the button:
},
```
#### `pomodoro`
### `pomodoro`
> Pomodoro plugin. One click to start the work timer, longclick to start the rest timer. Click in progress for reset.
```js
```javascript
{
"type": "pomodoro",
"workTime": 1200, // set time work in seconds. Default 1500 (25 min)
@ -325,22 +319,22 @@ To close a group, use the button:
},
```
#### `network`
### `network`
> Network plugin. The plugin to show usage a network
```js
```javascript
{
"type": "network",
"flip": true
},
```
#### `dock`
### `dock`
> Dock plugin
```js
```javascript
{
"type": "dock",
"filter": "(^Xcode$)|(Safari)|(.*player)",
@ -351,7 +345,8 @@ To close a group, use the button:
## Actions:
- `hidKey`
> https://github.com/aosm/IOHIDFamily/blob/master/IOHIDSystem/IOKit/hidsystem/ev_keymap.h use only numbers
> <https://github.com/aosm/IOHIDFamily/blob/master/IOHIDSystem/IOKit/hidsystem/ev_keymap.h> use only numbers
```json
"action": "hidKey",
@ -367,7 +362,7 @@ To close a group, use the button:
- `appleScript`
```js
```javascript
"action": "appleScript",
"actionAppleScript": {
"inline": "tell application \"Finder\"\rif not (exists window 1) then\rmake new Finder window\rset target of front window to path to home folder as string\rend if\ractivate\rend tell",
@ -377,16 +372,15 @@ To close a group, use the button:
- `shellScript`
```js
```javascript
"action": "shellScript",
"executablePath": "/usr/bin/pmset",
"shellArguments": ["sleepnow"], // optional
```
- `openUrl`
```js
```javascript
"action": "openUrl",
"url": "https://google.com",
```
@ -395,7 +389,7 @@ To close a group, use the button:
If you want to longPress for some operations, it is similar to the configuration for Actions but with additional parameters, for example:
```js
```javascript
"longAction": "hidKey",
"longKeycode": 53,
```
@ -417,32 +411,33 @@ If you want to longPress for some operations, it is similar to the configuration
- `align` can stick the item to the side. default is center
```js
```javascript
"align": "left" // "left", "right" or "center"
```
- `bordered` you can do button without border
```js
```javascript
"bordered": "false" // "true" or "false"
```
- `background` allow to specify you button background color
```js
```javascript
"background": "#FF0000",
```
by using background with color "#000000" and bordered == false you can create button without gray background but with background when the button is pressed
- `title` specify button title
```js
```javascript
"title": "hello"
```
- `image` specify button icon
```js
```javascript
"image": {
//Can be either of those
"base64": "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAABGdB...."
@ -451,7 +446,6 @@ by using background with color "#000000" and bordered == false you can create bu
}
```
### Roadmap
- [x] Create the first prototype with TouchBar in Storyboard
@ -467,7 +461,7 @@ by using background with color "#000000" and bordered == false you can create bu
- [x] JSON or another approch for save preset, maybe in `~/Library/Application Support/MTMR/`
- [x] Custom buttons size, actions by click
- [x] Layout: [always left, NSSliderView for center, always right]
- [x] System for autoupdate (https://sparkle-project.org/)
- [x] System for autoupdate (<https://sparkle-project.org/>)
- [ ] Overwrite default values from item types (e.g. title for brightness)
- [ ] Custom settings for paddings and margins for buttons
- [ ] XPC Service for scripts
@ -480,7 +474,7 @@ Settings:
- [x] Startup at login
- [ ] Show on/off in Dock
- [ ] Show on/off in StatusBar
- [ x] On/off Haptic Feedback
- [x] On/off Haptic Feedback
Maybe:

View File

@ -1,20 +0,0 @@
<?xml version="1.0" standalone="yes"?>
<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" version="2.0">
<channel>
<item>
<title>File Doesn't Exist, Will Create: MTMR.app/Contents/Info.plist</title>
<pubDate>Tue, 07 Apr 2020 05:14:23 +0530</pubDate>
<description>
</description>
<sparkle:minimumSystemVersion>File Doesn't Exist, Will Create: MTMR.app/Contents/Info.plist</sparkle:minimumSystemVersion>
<enclosure url="https://mtmr.app/MTMR%20File Doesn't Exist, Will Create: MTMR.app/Contents/Info.plist.dmg"
sparkle:version="File Doesn't Exist, Will Create: MTMR.app/Contents/Info.plist"
sparkle:shortVersionString="File Doesn't Exist, Will Create: MTMR.app/Contents/Info.plist"
length=""
type="application/octet-stream"
sparkle:dsaSignature=""
/>
</item>
</channel>
</rss>