brew install --cask mtmrNa primeira instalação, você precisa permitir o acesso ao MTMR em acessibilidade, caso contrário, botões como ESC , volume , brilho e outras chaves do sistema não funcionam.

? → Preferências do sistema → Segurança e privacidade → Privacidade da guia → Acessibilidade → MTMR
Predefinições MTMR

As preferências MTMR são armazenadas em ~/Library/Application Support/MTMR/items.json .
A configuração pré-instalada contém menos ou mais do que você provavelmente deseja, tente configurar:
Botões
Plugins nativos
Chaves de mídia
Plugins de AppleScript
Botões personalizados
Por padrão, você pode ativar gestos básicos no menu do aplicativo (barra de status -> Ícone MTMR -> Gestos de Volume/Brilho):
Você pode adicionar ações personalizadas para dois swipes de dois/quatro dedos. Para fazer isso, você precisa usar o tipo de swipe :
"type" : " swipe " ,
"fingers" : 2 , // number of fingers required (2,3 or 4)
"direction" : " right " , // direction of swipe (right/left)
"minOffset" : 10 , // optional: minimal required offset for gesture to emit event
"sourceApple" : { // optional: apple script to run
"inline" : " beep "
},
"sourceBash" : { // optional: bash script to run
"inline" : " touch /Users/lobster/test "
} Você pode criar quantos objetos swipe na predefinição quiser.
staticButton "type" : " staticButton " ,
"title" : " esc " ,appleScriptTitledButton {
"type" : "appleScriptTitledButton" ,
"refreshInterval" : 60 , //optional
"source" : {
"filePath" : "~/Library/Application Support/MTMR/iTunes.nowPlaying.scpt" ,
// or
"inline" : "tell application "Finder"rif not (exists window 1) thenrmake new Finder windowrset target of front window to path to home folder as stringrend ifractivaterend tell" ,
// or
"base64" : "StringInbase64"
} ,
}Nota: Você pode alterar o ícone de AppleScriptTitledButton seguindo estas etapas:
alternativeImages{"TITLE", "IMAGE_LABEL"}IMAGE_LABEL seja declarado no campo alternativeImagesExemplo:
{
"type" : "appleScriptTitledButton" ,
"source" : {
"inline" : "if (random number from 1 to 2) = 1 thenntset val to {"title", "play"}nelsentset val to {"title", "pause"}nend ifnreturn val"
} ,
"refreshInterval" : 1 ,
"image" : {
"base64" : "iVBORw0KGgoAAAANSUhEUgA..."
} ,
"alternativeImages" : {
"play" : {
"base64" : "iVBORw0KGgoAAAANSUhEUgAAAAAA..."
} ,
"pause" : {
"base64" : "iVBORw0KGgoAAAANSUhEUgAAAIAA..."
}
}
} , shellScriptTitledButtonNota: O script também pode usar sequências de escape para retornar cores (leia https://misc.flogisoft.com/bash/tip_colors_and_formatting para obter mais informações) "16 cores" é o único modo suportado atualmente. Os botões definirão sua própria cor de fundo para a cor retornada.
Exemplo do botão "CPU Load", que também muda de cor com base no valor da carga (Nota: o plug -in cpu nativo é executado melhor):
{
"type" : "shellScriptTitledButton" ,
"width" : 80 ,
"refreshInterval" : 2 ,
"source" : {
"inline" : "top -l 2 -n 0 -F | egrep -o ' \d*\.\d+% idle' | tail -1 | awk -F% '{p = 100 - $1; if (p > 30) c = "\033[33m"; if (p > 70) c = "\033[30;43m"; printf "%s%4.1f%%\n", c, p}'"
} ,
"actions" : [
{
"trigger" : "singleTap" ,
"action" : "appleScript" ,
"actionAppleScript" : {
"inline" : "activate application "Activity Monitor"rtell application "System Events"rttell process "Activity Monitor"rtttell radio button "CPU" of radio group 1 of group 2 of toolbar 1 of window 1 to perform action "AXPress"rtend tellrend tell"
}
}
] ,
"align" : "right" ,
"image" : {
// Or you can specify a filePath here.
// Images will be resized to 24x24.
// "filePath": "~/myproject/myimage.jpg" // or "/fixed/path/to/the.png"
"base64" :
"iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAA/1BMVEUAAADaACbYACfYACfjABzXACjYACfXACjYACfYACfYACfYACfdACLYACfXACjYACfVACv/AADXACjYACfYACfXACjYACfXACjaACXYACfYACfVACvYACfYACfZACbZACbYACfYACfZACb/AADYACfYACfVACrXACjVACu/AEDYACfYACfYACfXACjXACjYACfXACjYACfYACfYACfXACjYACfXACjYACfYACfZACbYACfYACfMADPYACfYACfYACfYACfYACfZACbXACjYACfYACfRAC7XACjYACfZACbWACn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JrFNd3p+K67MQtyrsp3w2G7xbHd5Plv83z3Wj6b3V9N9ssFv7afaa//ZPn3wD4/vje8PP/N7TebS0hgZhEAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE4LTA4LTIyVDE3OjUyOjIyKzAyOjAwc2qUYAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxOC0wOC0yMlQxNzo1MjoyMiswMjowMAI3LNwAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAAAElFTkSuQmCC"
} ,
"bordered" : false
} {
"type" : "group" ,
"align" : "center" ,
"bordered" : true ,
"title" : "stats" ,
"items" : [
{ "type" : "play" } ,
{ "type" : "mute" } ,
...
]
}Para fechar um grupo, use o botão:
{
"type": "close",
"width": 64
},
cpuMostra a carga atual da CPU em porcentagem, altera a cor com base no valor da carga. Possui menor consumo de energia e maior estabilidade do que a solução baseada em conchas.
{
"type" : "cpu" ,
"refreshInterval" : 3 ,
"width" : 80
} timeButtonNOTA: Alguns valores não funcionam corretamente: https://en.wikipedia.org/wiki/List_Of_Time_Zone_ABBreviations
Exemplos formattemplate: https://www.datetimeformatter.com/how-to-matat-date time-in-swift/
Exemplos de localidade: https://gist.github.com/jacobbubu/1836273
{
"type" : "timeButton" ,
"formatTemplate" : "dd HH:mm" ,
"locale" : "en_GB" ,
"timeZone" : "UTC"
} weatherProvedor: https://openweathermap.org
Nota: Registre -se em https://openweathermap.org para obter sua chave de API
NOTA: Aguarde 20 minutos ou mais para o OpenWeathermap ativar sua chave da API.
Nota: Ativar MTMR em "Serviços de Localização" no painel "Segurança e Privacidade" Preferências
"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)Provedor: https://yandex.ru/pogoda. Um clique para abrir a previsão do tempo no seu navegador.
Nota: Ativar MTMR em "Serviços de Localização" no painel "Segurança e Privacidade" Preferências
"type" : "yandexWeather" ,
"refreshInterval" : 600 // in seconds currencyProvedor: 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
} , pomodoroPlugin pomodoro. Uma torneira inicia o temporizador de trabalho, pressiona há muito tempo para iniciar o cronômetro de restante. Toque em um temporizador em andamento para redefinir.
{
"type" : "pomodoro" ,
"workTime" : 1200 , // set time work in seconds. Default 1500 (25 min)
"restTime" : 600 // set time rest in seconds. Default 300 (5 min)
} , networkPlugin de rede. O plugin para mostrar o uso da rede
{
"type" : "network" ,
"flip" : true ,
"units" : "dynamic" // or B/s, KB/s, MB/s, GB/s
} , dockPlug -in de dock
{
"type" : "dock" ,
"filter" : "(^Xcode$)|(Safari)|(.*player)" ,
"autoResize" : true
} , upnextO próximo plug -in de calendário exibe os próximos eventos do calendário MacOS. Não exibe evento atual.
{
"type" : "upnext" ,
"from" : 0 , // Lower bound of search range for next event in hours. Default 0 (current time)(can be negative to view events in the past)
"to" : 12 , // Upper bounds of search range for next event in hours. Default 12 (12 hours in the future)
"maxToShow" : 3 , // Limits the maximum number of events displayed. Default 3 (the first 3 upcoming events)
"autoResize" : false // If true, widget will expand to display all events. Default false (scrollable view within "width")
} , "actions" : [
{
"trigger" : "singleTap" ,
"action" : "hidKey" ,
"keycode" : 53
}
]singleTapdoubleTaptripleTaplongTaphidKeyhttps://github.com/aosm/iohidfamily/blob/master/iohidsystem/iokit/hidsystem/ev_keymap.h use apenas números
"action" : " hidKey " ,
"keycode" : 53 ,keyPresshttps://eastmanReference.com/complete-list-oplescript-key-codes
"action" : " keyPress " ,
"keycode" : 1 ,appleScript "action" : "appleScript" ,
"actionAppleScript" : {
"inline" : "tell application "Finder"rif not (exists window 1) thenrmake new Finder windowrset target of front window to path to home folder as stringrend ifractivaterend tell" ,
// "filePath" or "base64" will work as well
} ,shellScript "action" : "shellScript" ,
"executablePath" : "/usr/bin/pmset" ,
"shellArguments" : [ "sleepnow" ] , // optionalopenUrl "action" : "openUrl" ,
"url" : "https://google.com" , width restringe quanta sala um botão específico levará "width" : 34align pode enfiar o item ao lado. O padrão é o centro "align" : "left" // "left", "right" or "center"bordered você pode fazer o botão sem borda "bordered" : "false" // "true" or "false"background permitem especificar o botão da cor de fundo "background" : "#FF0000" ,Ao usar o fundo com a cor "#000000" e borda == FALSE, você pode criar um botão sem fundo cinza, mas com fundo quando o botão é pressionado
title especificar o título do botão "title" : "hello"image especificar o ícone do botão "image" : {
//Can be either of those
"base64" : "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAABGdB...."
//or
"filePath" : "~/img.png"
}matchAppId exibe o botão somente quando o ID do aplicativo ativo corresponde a regexp "matchAppId" : " Safari " open -a TextEdit ~/Library/Application Support/MTMR/items.json comando e pressione Enter Revicker ou verifique um carrapato para acesso? → Preferências do sistema → Segurança e privacidade → Tab Privacidade → Acessibilidade → MTMR
Construído por @toxblh e @redEtection.