mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-11-01 11:08:34 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
238b15b6a4 | ||
|
|
732fd5c5b5 | ||
|
|
f4b8e1f39a | ||
|
|
807290ff0c | ||
|
|
0775ea0412 |
+2
-2
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.19.1</string>
|
||||
<string>0.19.3</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>125</string>
|
||||
<string>130</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
|
||||
@@ -325,7 +325,7 @@ class SupportedTypesHolder {
|
||||
enum ItemType: Decodable {
|
||||
case staticButton(title: String)
|
||||
case appleScriptTitledButton(source: SourceProtocol, refreshInterval: Double)
|
||||
case timeButton(formatTemplate: String)
|
||||
case timeButton(formatTemplate: String, timeZone: String?)
|
||||
case battery()
|
||||
case dock()
|
||||
case volume()
|
||||
@@ -347,6 +347,7 @@ enum ItemType: Decodable {
|
||||
case from
|
||||
case to
|
||||
case full
|
||||
case timeZone
|
||||
case units
|
||||
case api_key
|
||||
case icon_type
|
||||
@@ -392,7 +393,8 @@ enum ItemType: Decodable {
|
||||
|
||||
case .timeButton:
|
||||
let template = try container.decodeIfPresent(String.self, forKey: .formatTemplate) ?? "HH:mm"
|
||||
self = .timeButton(formatTemplate: template)
|
||||
let timeZone = try container.decodeIfPresent(String.self, forKey: .timeZone) ?? nil
|
||||
self = .timeButton(formatTemplate: template, timeZone: timeZone)
|
||||
|
||||
case .battery:
|
||||
self = .battery()
|
||||
|
||||
@@ -24,7 +24,7 @@ extension ItemType {
|
||||
return "com.toxblh.mtmr.staticButton."
|
||||
case .appleScriptTitledButton(source: _):
|
||||
return "com.toxblh.mtmr.appleScriptButton."
|
||||
case .timeButton(formatTemplate: _):
|
||||
case .timeButton(formatTemplate: _, timeZone: _):
|
||||
return "com.toxblh.mtmr.timeButton."
|
||||
case .battery():
|
||||
return "com.toxblh.mtmr.battery."
|
||||
@@ -251,8 +251,8 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
|
||||
barItem = CustomButtonTouchBarItem(identifier: identifier, title: title)
|
||||
case .appleScriptTitledButton(source: let source, refreshInterval: let interval):
|
||||
barItem = AppleScriptTouchBarItem(identifier: identifier, source: source, interval: interval)
|
||||
case .timeButton(formatTemplate: let template):
|
||||
barItem = TimeTouchBarItem(identifier: identifier, formatTemplate: template)
|
||||
case .timeButton(formatTemplate: let template, timeZone: let timeZone):
|
||||
barItem = TimeTouchBarItem(identifier: identifier, formatTemplate: template, timeZone: timeZone)
|
||||
case .battery():
|
||||
barItem = BatteryBarItem(identifier: identifier)
|
||||
case .dock:
|
||||
|
||||
@@ -4,8 +4,11 @@ class TimeTouchBarItem: CustomButtonTouchBarItem {
|
||||
private let dateFormatter = DateFormatter()
|
||||
private var timer: Timer!
|
||||
|
||||
init(identifier: NSTouchBarItem.Identifier, formatTemplate: String) {
|
||||
dateFormatter.setLocalizedDateFormatFromTemplate(formatTemplate)
|
||||
init(identifier: NSTouchBarItem.Identifier, formatTemplate: String, timeZone: String? = nil) {
|
||||
dateFormatter.dateFormat = formatTemplate
|
||||
if let abbr = timeZone {
|
||||
dateFormatter.timeZone = TimeZone(abbreviation: abbr)
|
||||
}
|
||||
super.init(identifier: identifier, title: " ")
|
||||
timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(updateTime), userInfo: nil, repeats: true)
|
||||
isBordered = false
|
||||
|
||||
@@ -26,6 +26,7 @@ VERSION=`/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" ${NAME}.a
|
||||
MINIMUM=`/usr/libexec/PlistBuddy -c "Print LSMinimumSystemVersion" ${NAME}.app/Contents/Info.plist`
|
||||
SIZE=`stat -f%z MTMR\ ${VERSION}.dmg`
|
||||
SIGN=`~/Sparkle/bin/sign_update MTMR\ ${VERSION}.dmg ~/Sparkle/bin/dsa_priv.pem | awk '{printf "%s",$0} END {print ""}'`
|
||||
SHA256=`shasum -a 256 MTMR\ ${VERSION}.dmg | awk '{print $1}'`
|
||||
|
||||
# ditto -c -k --sequesterRsrc --keepParent "${NAME}.app" "${NAME}v${VERSION}.zip"
|
||||
|
||||
@@ -57,5 +58,12 @@ echo "<?xml version=\"1.0\" standalone=\"yes\"?>
|
||||
</channel>
|
||||
</rss>" > appcast.xml
|
||||
|
||||
echo ""
|
||||
echo "Homebrew https://github.com/Homebrew/homebrew-cask/edit/master/Casks/mtmr.rb"
|
||||
echo ""
|
||||
echo " version '${VERSION}'"
|
||||
echo " sha256 '${SHA256}'"
|
||||
echo ""
|
||||
|
||||
scp MTMR\ ${VERSION}.dmg do:/var/www/mtmr
|
||||
scp appcast.xml do:/var/www/mtmr
|
||||
|
||||
Reference in New Issue
Block a user