Compare commits

...
5 Commits
Author SHA1 Message Date
toxblh 238b15b6a4 fix drop MTMR without timeZone 2019-01-23 12:43:25 +03:00
toxblh 732fd5c5b5 add helpers for fast update homebrew 2019-01-22 19:20:40 +03:00
toxblh f4b8e1f39a switch from localized to custom templates 2019-01-22 12:46:17 +03:00
toxblh 807290ff0c improve build.sh 2019-01-22 12:21:38 +03:00
toxblh 0775ea0412 added timeZone settings for timeButton. #136 2019-01-22 12:11:31 +03:00
5 changed files with 22 additions and 9 deletions
+2 -2
View File
@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.19.1</string> <string>0.19.3</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>125</string> <string>130</string>
<key>LSApplicationCategoryType</key> <key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string> <string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>
+4 -2
View File
@@ -325,7 +325,7 @@ class SupportedTypesHolder {
enum ItemType: Decodable { enum ItemType: Decodable {
case staticButton(title: String) case staticButton(title: String)
case appleScriptTitledButton(source: SourceProtocol, refreshInterval: Double) case appleScriptTitledButton(source: SourceProtocol, refreshInterval: Double)
case timeButton(formatTemplate: String) case timeButton(formatTemplate: String, timeZone: String?)
case battery() case battery()
case dock() case dock()
case volume() case volume()
@@ -347,6 +347,7 @@ enum ItemType: Decodable {
case from case from
case to case to
case full case full
case timeZone
case units case units
case api_key case api_key
case icon_type case icon_type
@@ -392,7 +393,8 @@ enum ItemType: Decodable {
case .timeButton: case .timeButton:
let template = try container.decodeIfPresent(String.self, forKey: .formatTemplate) ?? "HH:mm" 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: case .battery:
self = .battery() self = .battery()
+3 -3
View File
@@ -24,7 +24,7 @@ extension ItemType {
return "com.toxblh.mtmr.staticButton." return "com.toxblh.mtmr.staticButton."
case .appleScriptTitledButton(source: _): case .appleScriptTitledButton(source: _):
return "com.toxblh.mtmr.appleScriptButton." return "com.toxblh.mtmr.appleScriptButton."
case .timeButton(formatTemplate: _): case .timeButton(formatTemplate: _, timeZone: _):
return "com.toxblh.mtmr.timeButton." return "com.toxblh.mtmr.timeButton."
case .battery(): case .battery():
return "com.toxblh.mtmr.battery." return "com.toxblh.mtmr.battery."
@@ -251,8 +251,8 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
barItem = CustomButtonTouchBarItem(identifier: identifier, title: title) barItem = CustomButtonTouchBarItem(identifier: identifier, title: title)
case .appleScriptTitledButton(source: let source, refreshInterval: let interval): case .appleScriptTitledButton(source: let source, refreshInterval: let interval):
barItem = AppleScriptTouchBarItem(identifier: identifier, source: source, interval: interval) barItem = AppleScriptTouchBarItem(identifier: identifier, source: source, interval: interval)
case .timeButton(formatTemplate: let template): case .timeButton(formatTemplate: let template, timeZone: let timeZone):
barItem = TimeTouchBarItem(identifier: identifier, formatTemplate: template) barItem = TimeTouchBarItem(identifier: identifier, formatTemplate: template, timeZone: timeZone)
case .battery(): case .battery():
barItem = BatteryBarItem(identifier: identifier) barItem = BatteryBarItem(identifier: identifier)
case .dock: case .dock:
+5 -2
View File
@@ -4,8 +4,11 @@ class TimeTouchBarItem: CustomButtonTouchBarItem {
private let dateFormatter = DateFormatter() private let dateFormatter = DateFormatter()
private var timer: Timer! private var timer: Timer!
init(identifier: NSTouchBarItem.Identifier, formatTemplate: String) { init(identifier: NSTouchBarItem.Identifier, formatTemplate: String, timeZone: String? = nil) {
dateFormatter.setLocalizedDateFormatFromTemplate(formatTemplate) dateFormatter.dateFormat = formatTemplate
if let abbr = timeZone {
dateFormatter.timeZone = TimeZone(abbreviation: abbr)
}
super.init(identifier: identifier, title: " ") super.init(identifier: identifier, title: " ")
timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(updateTime), userInfo: nil, repeats: true) timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(updateTime), userInfo: nil, repeats: true)
isBordered = false isBordered = false
+8
View File
@@ -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` MINIMUM=`/usr/libexec/PlistBuddy -c "Print LSMinimumSystemVersion" ${NAME}.app/Contents/Info.plist`
SIZE=`stat -f%z MTMR\ ${VERSION}.dmg` 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 ""}'` 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" # ditto -c -k --sequesterRsrc --keepParent "${NAME}.app" "${NAME}v${VERSION}.zip"
@@ -57,5 +58,12 @@ echo "<?xml version=\"1.0\" standalone=\"yes\"?>
</channel> </channel>
</rss>" > appcast.xml </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 MTMR\ ${VERSION}.dmg do:/var/www/mtmr
scp appcast.xml do:/var/www/mtmr scp appcast.xml do:/var/www/mtmr