1
0
mirror of https://github.com/Toxblh/MTMR.git synced 2026-01-09 16:48:38 +00:00
Go to file
Anton Palgunov 95271dba0e
HapticFeedback: fix broken haptic for Release builds + refactori… (#198)
HapticFeedback: fix broken haptic for Release builds + refactoring
2019-07-28 00:17:18 +01:00
.github Create FUNDING.yml 2019-05-23 14:16:25 +01:00
MTMR CurrencyBarItem: fix text vertical alignment 2019-07-27 18:10:48 +02:00
MTMR.xcodeproj Add new "yandexWeather" widget 2019-07-23 17:07:47 +04:00
MTMRTests Revert "fixed tests" 2019-05-15 16:39:32 +01:00
Resources move ss.png to Resources 2019-05-22 22:47:58 +01:00
Sparkle.framework Ready to autoupdates 2018-09-19 23:53:06 +01:00
.gitignore upd gitignore 2019-01-17 01:51:42 +00:00
.travis.yml travis update 2018-09-20 12:20:58 +01:00
build.sh Style format 2019-01-24 00:04:30 +03:00
export-options.plist Scripts for create dmg 2018-04-13 22:14:38 +01:00
LICENSE Create LICENSE 2018-04-09 08:33:02 +01:00
README.md README: add "yandexWeather" to the list of "Native Plugins" on top 2019-07-23 18:54:07 +04:00
TECHNICAL_DEBT.md handy method to open particular preset file, expose bug with wrong preset reload on group close 2018-06-03 00:49:48 +07:00
test.sh fix tesh script 2019-02-24 23:08:22 +00:00

My touchbar. My rules. GitHub release licenseminimal system requirements travis

The TouchBar Customization App for your MacBook Pro

My idea is to create a platform for creating plugins to customize the TouchBar. I very much like BTT and having a full custom TouchBar (my BTT preset), and I wanted to create it. It's my first Swift project for MacOS :)

Share your presets here

Mackbook with touchbar

Discord Telegram

PayPal donate button Buy Me A Coffee My TouchBar My Rules (MTMR)

Installation

On first install you need to allow access for MTMR in Accessibility otherwise buttons like Esc, Volume, Brightness and other system keys won't work

screenshot 2019-02-24 at 23 19 20

🍏→ System Preferences → Security and Privacy → tab Privacy → Accessibility → MTMR

Examples

Presets for touchbar

Customization

MTMR preferences are stored under ~/Library/Application\ Support/MTMR/items.json.

The pre-installed configuration contains less or more than you'll probably want, try to configure:

Built-in button types:

Buttons

  • escape
  • exitTouchbar
  • brightnessUp
  • brightnessDown
  • illuminationUp (keyboard illumination)
  • illuminationDown (keyboard illumination)
  • volumeDown
  • volumeUp
  • mute

Native Plugins

  • battery
  • currency
  • weather
  • yandexWeather
  • inputsource
  • music (tap for pause, longTap for next)
  • dock (half-long click to open app, full-long click to kill app)
  • nightShift
  • dnd (Don't disturb)
  • darkMode
  • pomodoro
  • network

Media Keys

  • previous
  • play
  • next

AppleScript plugins

  • sleep
  • displaySleep

Gestures on central part:

  • two finger slide: change you Volume
  • three finger slide: change you Brightness

Built-in slider types:

  • brightness
  • volume

You can also make custom buttons using these types

  • staticButton
 "type": "staticButton",
 "title": "esc",
  • appleScriptTitledButton
    "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
  "type": "timeButton",
  "formatTemplate": "HH:mm" //optional

Groups

{
"type": "group",
"align": "center",
"bordered": true,
"title": "stats",
"items": [
    { "type": "play" }, { "type": "mute" }, ...]
}

To close a group, use the button:

{
"type": "close",
"width": 64
},

Native plugins

timeButton

Attention! Works not all: https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations

{
  "type": "timeButton",
  "formatTemplate": "dd HH:mm",
  "timeZone": "UTC"
}

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

  "type": "weather",
  "refreshInterval": 600, // in seconds
  "units": "metric", // or imperial
  "icon_type": "text" // or images
  "api_key": "" // you can get the key on openweather

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

  "type": "yandexWeather",
  "refreshInterval": 600 // in seconds

currency

Provider: https://coinbase.com

  "type": "currency",
  "refreshInterval": 600, // in seconds
  "align": "right",
  "from": "BTC",
  "to": "USD",
  "full": true // £‣1.29$

music

{
  "type": "music",
  "align": "center",
  "width": 80, // Optional
  "bordered": false, // Optional
  "refreshInterval": 2, // in seconds. Optional. Default 5 seconds
  "disableMarquee": true // to disable marquee effect. Optional. Default false
},

pomodoro

Pomodoro plugin. One click to start the work timer, longclick to start the rest timer. Click in progress for reset.

{
  "type": "pomodoro",
  "workTime": 1200, // set time work in seconds. Default 1500 (25 min)
  "restTime": 600 // set time rest in seconds. Default 300 (5 min)
},

network

Network plugin. The plugin to show usage a network

{
  "type": "network",
  "flip": true
},

dock

Dock plugin

{
  "type": "dock",
  "autoResize": true
},

Actions:

 "action": "hidKey",
 "keycode": 53,
  • keyPress
 "action": "keyPress",
 "keycode": 1,
  • appleScript
 "action": "appleScript",
 "actionAppleScript": {
     "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
 },
  • shellScript
 "action": "shellScript",
 "executablePath": "/usr/bin/pmset",
 "shellArguments": ["sleepnow"], // optional

  • openUrl
 "action": "openUrl",
 "url": "https://google.com",

LongActions

If you want to longPress for some operations, it is similar to the configuration for Actions but with additional parameters, for example:

 "longAction": "hidKey",
 "longKeycode": 53,
  • longAction
  • longKeycode
  • longActionAppleScript
  • longExecutablePath
  • longShellArguments
  • longUrl

Additional parameters:

  • width restrict how much room a particular button will take
  "width": 34
  • align can stick the item to the side. default is center
  "align": "left" // "left", "right" or "center"
  • bordered you can do button without border
  "bordered": "false" // "true" or "false"

Roadmap

  • Create the first prototype with TouchBar in Storyboard
  • Put in stripe menu on startup the application
  • Find how to simulate real buttons like brightness, volume, night shift and etc.
  • Time in touchbar!
  • First the weather plugin
  • Find how to open full-screen TouchBar without the cross and stripe menu
  • Find how to add haptic feedback
  • Add icon and menu in StatusBar
  • Hide from Dock
  • Status menu: "preferences", "quit"
  • JSON or another approch for save preset, maybe in ~/Library/Application Support/MTMR/
  • Custom buttons size, actions by click
  • Layout: [always left, NSSliderView for center, always right]
  • 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
  • UI for settings
  • Import config from BTT

Settings:

  • Interface for plugins and export like presets
  • Startup at login
  • Show on/off in Dock
  • Show on/off in StatusBar
  • On/off Haptic Feedback

Maybe:

  • Refactoring the application into packages (AppleScript, JavaScript? and Swift?)

Credits

Built by @Toxblh and @ReDetection.

Analytics