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
- Download lastest release (.dmg) from github
- Or via Homebrew
brew cask install mtmr
- Dario Prski has written a fantastic article on medium that goes into more detail on installing MTMR
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
๐โ System Preferences โ Security and Privacy โ tab Privacy โ Accessibility โ MTMR
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:
Buttons
- escape
- exitTouchbar
- brightnessUp
- brightnessDown
- illuminationUp (keyboard illumination)
- illuminationDown (keyboard illumination)
- volumeDown
- volumeUp
- mute
Native Plugins
- battery
- currency
- weather
- 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
- two finger slide: change you Volume
- three finger slide: change you Brightness
- brightness
- volume
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
{
"type": "group",
"align": "center",
"bordered": true,
"title": "stats",
"items": [
{ "type": "play" }, { "type": "mute" }, ...]
}
To close a group, use the button:
{
"type": "close",
"width": 64
},
Attention! Works not all: https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations
{
"type": "timeButton",
"formatTemplate": "dd HH:mm",
"timeZone": "UTC"
}
Provider: https://openweathermap.org Need allowance location service
"type": "weather",
"refreshInterval": 600, // in seconds
"units": "metric", // or imperial
"icon_type": "text" // or images
"api_key": "" // you can get the key on openweather
Provider: https://coinbase.com
"type": "currency",
"refreshInterval": 600, // in seconds
"align": "right",
"from": "BTC",
"to": "USD",
"full": true // ยฃโฃ1.29$
{
"type": "music",
"align": "center",
"width": 80,
"bordered": false,
"refreshInterval": 2, // in seconds
},
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 plugin. The plugin to show usage a network
{
"type": "network",
"flip": true
},
Dock plugin
{
"type": "dock",
"autoResize": true
},
hidKey
https://github.com/aosm/IOHIDFamily/blob/master/IOHIDSystem/IOKit/hidsystem/ev_keymap.h use only numbers
"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",
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
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"
- 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?)
Built by @Toxblh and @ReDetection.