toxblh / mtmr Goto Github PK
View Code? Open in Web Editor NEWπ [My TouchBar My rules]. The Touch Bar Customisation App for your MacBook Pro
Home Page: https://mtmr.app
License: MIT License
π [My TouchBar My rules]. The Touch Bar Customisation App for your MacBook Pro
Home Page: https://mtmr.app
License: MIT License
hello, me again! just a quick idea. Since i saw this integration :
music (tap for pause, longTap for next)
i thougt it was about a new feat for all buttons, quick example :
{
"type": "staticButton",
"title": "π© ",
"actions" : [ {
"kind": "tap",
"type": "appleScript",
"actionAppleScript": {
"filePath": "script1.applescript",
}
},{
"kind": "longTap",
"type": "appleScript",
"actionAppleScript": {
"filePath": "script2.applescript",
}
}],
"width": 34,
"align": "right"
},
I thought about fours actions :
example with vox or itunes (this reduces the number of buttons and saves space)
example with reminders
example with a custom timer in apple script (inspired from touch bar timer)
Actually I'm talking about script by action, but I'm just starting to test AppleScript, maybe we can give the var "kind" two the script, in order to have one script for all actions.
I'm juste sharing the idea, as soon as I have a little time I would not hesitate to PR if I can :)
Really cool project, it's the first time I feel that i can do something with my Touch Bar π
Not sure if it even possible - I do really like functionality provided by MTMR - in the same time i'd like to have be able to mix it with functionality provided by application itself
e.g. : IDEA provides reach functionality - not even a single button to run tests, to do debug step and whatever (even not sure if it provides control over actions with applescript)
https://blog.jetbrains.com/idea/2018/05/intellij-idea-2018-2-early-access-program-is-open/
Sorry if this is not the right place to request new features, but adding config for a shuffle on\off toggle would be amazing.
Awesome work guys! That's a great tool!
However I'd like to have a mute button instead of having to slide down to zero.
I tried multiple ways to add a custom applescript button but none worked π
This is my last attempt :
{
"type": "staticButton",
"align": "right",
"image": { "base64" :"a real base 64 that is way too long"},
"action": "appleScript",
"actionAppleScript": {
"source": "/Users/acalmette/mute.scpt"
},
"width": 36
}
I tried to inline the script which is :
set curVolume to get volume settings
if output muted of curVolume is false then
set volume with output muted
else
set volume without output muted
end if
And it didn't work neither.
Note that the script works when played by script editor.
Any ideas?
This will not work, although image renders correctly:
{
"type": "staticButton",
"action": "shellScript",
"executablePath": "/usr/local/bin/maclock",
"width": 36,
"align": "left",
"image": {
"base64":
"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAAiEAAAIhAENVwL6AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAQtQTFRF////gICA////VVVV////1dXVVWqA1dXVUmZ6xMzEWGh4ycnJUmt6U2x7Ump4Uml71t/bVGp72traVGp5U2x4yMrIU2l4VGl6xsrGVGp6VGp5U2t5U2l529/fyMvIusC/VGp5xsnGxsnGu8HAVGp5VWl5VGp53ODgx8rHVGt5mKSnx8rHVWl509nZ3+PjxsrGU2p54OTkVGp53+PjVGp51Nrbx8rHVGp5sLu/yMrI4eXmx8rH4ubnVGp54+npVGp5VGp55err5errTExPVGp5X19hX2BiYGFjZGRnZGVoZmZpfH1+gYKDhIWGiIqMj5GTk5WXlJaWp6qsu767wsXCx8rH2Nze4ebn5+ztsVhOVQAAAEN0Uk5TAAICAwQGDAwZHiAhMjQ1ODg6PlJTYWhtfoCLjZadoaOkq7C1t7i5vsDJyc3Q3Nzd4uPm5+jp6u/v7+/w9ff6/P39/otxtB4AAAEASURBVDhPpdDnTgJBFAXgRYqAFCmCNEFUEERERJbe7hE7RVB4/ycxkCEzu7BjIufXnJwvuckoCo8pGM1UKplo0KTsjCsHlpxr1x7pAeWrWOyyDPQi23sAUMPm1cscVoGAfneqKNk3xV6C6tSBONpu3txtxHWggJRYUyhod1sXIbGH0LVpgAfwid0HeDTAC3hlfW9wcJLM5y/S6zys81ir3SYsm916/c2z5GkcMnAq7CJYZhm4MQItBupGYMBAk8+zj/GPFLwTjaRgSPQqBU9EL/uBZ6I3KfgkmkjBfPq1kII/P+qf4M4IdBg4MwJFBhziDfHCMQPK0Xl1G/Tv/avtFzQPtEKn9N7CAAAAAElFTkSuQmCC"
}
},
this works but not render image
{
"type": "staticButton",
"action": "shellScript",
"executablePath": "/usr/local/bin/maclock",
"width": 36,
"align": "left",
"title": "π"
},
this works fine
{
"type": "staticButton",
"action": "shellScript",
"executablePath": "/usr/local/bin/maclock",
"width": 36,
"align": "left",
"title": "sleep"
},
Goal: to show folder and git branch of active session of iterm2 on touch bar
How: using iterm2_shell_integration in my ~/.zshrc
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
iterm2_print_user_vars() {
iterm2_set_user_var dirInfo $(print -P "%$(( $COLUMNS ))<...<%~%<<$(git branch 2>/dev/null | grep '\*' | sed 's,* \(.*\),[\1],')")
}
and MTMR items:
{
"type": "appleScriptTitledButton",
"source": {
"inline":
"if application \"iTerm2\" is frontmost then tell application \"iTerm2\"\rtell current session of current window\rreturn (variable named \"user.dirInfo\")\rend tell\rend tell\r"
},
"action": "appleScript",
"actionAppleScript": {
"inline":
""
},
"refreshInterval": 1
}
It works while folder doesn't have any spaces:
in case of /Applications/Sublime Text.app
it shows just /Applications/Sublime
the same happens if I try to use space separator between folder and git branch name.
Only over the Music Widget.
Here is a screen shot in safari when watching video stream like youtube or twitch.tv
The center part is a timeline slider and on the right of it, the picture-in-picture toggle icon
more info about PiP : https://support.apple.com/en-us/HT206997
Hi everybody, it is strange, but i've found no way to exit from opened group (return to mtmr bar). There is no "type" for it. What i'm missing?
Would be good do some actions when some condition matches like to hide/show some item.
It is just some examples:
Show/Hide battery.
{ "id" : "battery_level", "type": "battery", "align": "right" },
{
"type" : "condition",
"refreshInterval": 60,
"script" : {
"type" : "appleScriptInline",
"value" : "do shell script \"script that returns battery_charged when battery is charged\""
},
"conditions" : [
{
"condition" : "=", "value" : "battery_charged",
"actions" : [{ "type" : "hide_item", "id" : "battery_level"}]
},
{
"condition" : "!=", "value" : "battery_charged",
"actions" : [{ "type" : "show_item", "id" : "battery_level"}]
}
]
}
Hide Player buttons when needed:
{ "id" : "previous", "type": "previous", "width": 44 },
{ "id" : "play", "type": "play", "width": 44 },
{ "id" : "next", "type": "next", "width": 44 },
{
"type" : "condition",
"refreshInterval": 1,
"script": {
"type" : "appleScriptInline",
"value" : "if application \"Spotify\" is running then\rreturn \"playing\"\relse return\"\"\r"
},
"conditions" : [
{
"condition" : "=", "value" : "playing",
"actions" : [
{ "type" : "show_item", "id" : "previous"},
{ "type" : "show_item", "id" : "play"},
{ "type" : "show_item", "id" : "next"}
]
},
{
"condition" : "!=", "value" : "playing",
"actions" : [
{ "type" : "hide_item", "id" : "previous"},
{ "type" : "hide_item", "id" : "play"},
{ "type" : "hide_item", "id" : "next"}
]
},
]
}
Some apps has nice and useful touch bar, so it'll be good to let add them to some whitelist, so they won't be hijacked by MTMR. BTT has this thing like exclude specific apps.
Items without a defined align are randomly sorted by Reload Preset
I succeed in creating a dock in my touchbar. But I am not aware how it works and right now there is no documentation for that, too. Also, I notice that long press icons on the dock will close an app but clicking on each icon does nothing
I want to replace the default icon/text on a button with my own text.
{ "type": "exitTouchbar", "width": 44, "align": "left", "title":">" },
{ "type": "escape", "align": "left", title: "[Escape]" },
Found comment to BTT "Esc is nice, but I would pay for a real Delete key at the very right..."
Here you go, just add this to preset:
{
"type": "staticButton",
"title": "Del",
"width": 44,
"align": "right",
"action": "keyPress",
"keycode": 117
},
Could you please add this to documentation.
Is there any way to add a pomodoro timer? with configurabel pomodoro/short, long break?
Thanks a lot!
I use sleep
widget (not displaySleep
), if I try to login after sleep, the login with touch id not shown. Also there's a loading spinning a while (about 2-3 minutes) once I enter my password. Is anyone experiencing the same?
Also I don't have vox installed, maybe that causing it.
Hello,
just find something strange today :
"source": {
"filePath": "/Users/xxxx/Documents/appleScript/vox.applescript",
}
if application "VOX" is running then
tell application "VOX"
if player state is 1 then
set myArtist to (get artist)
set myTrack to (get track)
return myArtist & " β " & myTrack
else
return ""
end if
end tell
end if
result is ko -> no script
with inline :
"type": "appleScriptTitledButton",
"source": {
"inline":
"if application \"VOX\" is running then\rtell application \"VOX\"\rif player state is 1 then\rset myArtist to (get artist)\rset myTrack to (get track)\rreturn myArtist & \" β \" & myTrack\relse\rreturn \"\"\rend if\rend tell\rend if"
},
result is ok
Hi,
it would be great if the iTunes plugin/script would scroll from right to left if the artist and title is too long to be displayed as a whole on the Touch Bar. Is it clear what I'm trying to say?
I tried to install via Brew, but everytime I open it, it just beachballs and and the touchbar is unresponsive
One guy showed on reddit how he's using gestures in BTT.
I'm using two finger swipe to change the volume and three finger swipe to change brightness. You don't need to press a button and grab a slider, it works no matter where you press on the touchbar.
In the most recent update (2.500), go to the touchbar section and click on the "+Widget/Gesture".
I have it set up with left swipe to "Turn volume down - small step" and right swipe set to "Turn volume up - small step".
Would be nice to have something like this =)
Hey,
first of all, thank you for this tool, great idea buddy! :)
I would like to change the behavior of your sleep button to just lock the screen. Could you implement this? Something like mode={sleep|lock} maybe :)
For easy installs and updates, it would be great to be able to just do:
brew install mtmr
Hi, is there any roadmap for supporting Mojave?
Possible to activate it above all buttons when this gesture is detected ? actually it seems to be available only on the center :)
_another idea will be to add this in the config file in order to custom :
not sure it's a good idea, just for share if someone have other use cases._
When I slide the built-in brightness slider and release it, the screen brightness level changes as expected. But after several seconds, the slider reverts to its previous position, and the screen brightness also reverts to its previous level. This happens whether I adjust up or down.
If I instead use hidkey 2 & 3, the screen brightness level changes as expected and does not revert.
After upgrading to version 0.13.2 the app is not getting any weather data anymore.
I saw it.
Interesting solution for it saw here https://github.com/LumingYin/TouchBarDisabler/blob/2c25e8252ed3ebbd1826b85bfe80e58ebf89567b/TouchBarDisablerAppDelegate.m#L366
MTMR is great for me in all but one way: touching the buttons sometimes produces no result.
It can happen in any app, and I've tested across many. I believe it has to do with touch duration. If I hit a button really fast, the button brightens, but the haptic and the action do not fire.
Is there a threshold duration that has to be met, before the haptic and action are fired?
My current items.json
is tiny, while I experiment with MTMR-
[{
"type": "escape",
"width": 900,
"align": "center"
}]
It would be really awesome if we could add a button that adjusts the keyboard backlight brightness up/down.
Currently when is added \\
it shows as a bad preset
After setting dock in items.json, i can not open applications through the touch bar, when touching the icon, it does not work.
I want to make a button for screen-capture. Since I already have a keyboard shortcut that will launch screen-cap, seems like the easiest way is to create a "staticButton" with "keypress" action, but I don't know how to include a modifier (cmd,ctrl,shft) into the keycode.
Also, what does the "hidkey" action do?
It will be good if we can import presets from BTT
I have two currency-elements:
{ "type": "currency", "refreshInterval": 60, "from": "ETH", "to": "EUR" }
{ "type": "currency", "refreshInterval": 60, "from": "LTC", "to": "EUR" }
The second one won't update. Only when I do a "reload preset" the second one gets updated.
full-long click dock button doesn't work for the apps of Apple inc. And itβs a little difficult to operate, I have to try three times or more always before it works. Anyway it is a good tool, i have kept it all ready, thanks. Hope it work better.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.