mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-01-11 09:28:38 +00:00
weather – example on bundled scripts
This commit is contained in:
parent
b70c8ca4a3
commit
2bc8912add
@ -46,6 +46,14 @@ class SupportedTypesHolder {
|
||||
"previous": { _ in return (item: .staticButton(title: "⏪"), action: .hidKey(keycode: NX_KEYTYPE_PREVIOUS)) },
|
||||
"play": { _ in return (item: .staticButton(title: "⏯"), action: .hidKey(keycode: NX_KEYTYPE_PLAY)) },
|
||||
"next": { _ in return (item: .staticButton(title: "⏩"), action: .hidKey(keycode: NX_KEYTYPE_NEXT)) },
|
||||
"weather": { decoder in
|
||||
enum CodingKeys: String, CodingKey { case refreshInterval }
|
||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||
let interval = try container.decodeIfPresent(Double.self, forKey: .refreshInterval)
|
||||
let scriptURL = Bundle.main.url(forResource: "weather", withExtension: "scpt")!
|
||||
let item = ItemType.appleScriptTitledButton(source: try! String(contentsOf: scriptURL), refreshInterval: interval ?? 1800.0)
|
||||
return (item: item, action: .none)
|
||||
},
|
||||
]
|
||||
|
||||
static let sharedInstance = SupportedTypesHolder()
|
||||
|
||||
@ -10,4 +10,5 @@
|
||||
{ "type": "next" },
|
||||
{ "type": "volumeUp" },
|
||||
{ "type": "volumeUp" },
|
||||
{ "type": "weather", "refreshInterval": 1800 },
|
||||
]
|
||||
|
||||
@ -20,9 +20,10 @@ My the idea is to create the program like a platform for plugins for customizati
|
||||
- [x] First the weather plugin
|
||||
- [x] Find how to open full-screen TouchBar without the cross and stripe menu
|
||||
- [x] Find how to add haptic feedback
|
||||
- [ ] JSON or another approch for save preset and plugins maybe in `~/mtmr`
|
||||
- [x] JSON or another approch for save preset, maybe in `~/Library/Application Support/MTMR/`
|
||||
- [ ] Layout: [always left, NSSliderView for center, always right]
|
||||
- [ ] Custom buttons size, actions by click in settings
|
||||
- [ ] Overwrite default values from item types (e.g. title for brightness)
|
||||
- [ ] Add icon and menu in StatusBar
|
||||
- [ ] Hide from Dock
|
||||
- [ ] Status menu: "preferences", "quit"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user