terminal-notifier 1.5.2 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/vendor/terminal-notifier/README.markdown +27 -6
- data/vendor/terminal-notifier/Ruby/Rakefile +7 -3
- data/vendor/terminal-notifier/Terminal Notifier/AppDelegate.m +44 -19
- data/vendor/terminal-notifier/Terminal Notifier/Terminal Notifier-Info.plist +2 -2
- data/vendor/terminal-notifier/terminal-notifier.app/Contents/Info.plist +2 -2
- data/vendor/terminal-notifier/terminal-notifier.app/Contents/MacOS/terminal-notifier +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc0d510f599b6936ce8b16fbda223456053c2280
|
4
|
+
data.tar.gz: 314e51d3fdb3859e55a6b5500abe8fead4bbb6f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a21300312cffba5d3d617becb181325a4bdc93c5d6de395343f87c505bed0bfbde2d2c8bca0a288e789d2e723e1cda39d99487952c7ca94ad7cad6b230e0c5b1
|
7
|
+
data.tar.gz: 2f54d00f7f18b78aac700484634db6c43531496fcc299a51a8a2f9a9cfca75405d5df4d4f01d6584ea62508019ceb8a2901012e6eeecf9264bca650b5a6a1f9c
|
@@ -6,18 +6,23 @@ which are available in Mac OS X 10.8 and higher.
|
|
6
6
|
|
7
7
|
## Caveats
|
8
8
|
|
9
|
-
*
|
10
|
-
currently no way to specify a custom icon for a notification. The only
|
11
|
-
use this tool with your own icon is to use the `-sender` option or include a
|
9
|
+
* Under OS X 10.8, the Notification Center _always_ uses the application’s own
|
10
|
+
icon, there’s currently no way to specify a custom icon for a notification. The only
|
11
|
+
way to use this tool with your own icon is to use the `-sender` option or include a
|
12
12
|
build of terminal-notifier with your icon and **a different bundle identifier**
|
13
13
|
instead. (If you do not change the bundle identifier, launch services will use
|
14
14
|
a cached version of the icon.)
|
15
|
-
|
16
|
-
|
15
|
+
<br/>Consequently the `-appIcon` & `-contentImage` options aren't doing anything
|
16
|
+
under 10.8.
|
17
|
+
<br/>However, you _can_ use unicode symbols and emojis. See the examples.
|
17
18
|
|
18
19
|
* It is currently packaged as an application bundle, because `NSUserNotification`
|
19
20
|
does not work from a ‘Foundation tool’. [radar://11956694](radar://11956694)
|
20
21
|
|
22
|
+
* If you intend to package terminal-notifier with your app to distribute it on the
|
23
|
+
MAS, please use 1.5.2 since 1.6.0+ uses a private method override which is not
|
24
|
+
allowed in the AppStore guidelines.
|
25
|
+
|
21
26
|
|
22
27
|
## Download
|
23
28
|
|
@@ -67,7 +72,7 @@ $ terminal-notifier -group 'address-book-sync' -title 'Address Book Sync' -subti
|
|
67
72
|
#### Options
|
68
73
|
|
69
74
|
At a minimum, you have to specify either the `-message` , the `-remove`
|
70
|
-
|
75
|
+
or the `-list` option.
|
71
76
|
|
72
77
|
-------------------------------------------------------------------------------
|
73
78
|
|
@@ -161,6 +166,22 @@ For information on the `ID` see the `-activate` option.
|
|
161
166
|
|
162
167
|
-------------------------------------------------------------------------------
|
163
168
|
|
169
|
+
`-appIcon URL` **[10.9+ only]**
|
170
|
+
|
171
|
+
Specifies The URL of an image to display instead of the application icon.
|
172
|
+
|
173
|
+
**WARNING: This option is subject to change since it relies on a private method.**
|
174
|
+
|
175
|
+
-------------------------------------------------------------------------------
|
176
|
+
|
177
|
+
`-contentImage URL` **[10.9+ only]**
|
178
|
+
|
179
|
+
Specifies The URL of an image to display attached inside the notification.
|
180
|
+
|
181
|
+
**WARNING: This option is subject to change since it relies on a private method.**
|
182
|
+
|
183
|
+
-------------------------------------------------------------------------------
|
184
|
+
|
164
185
|
`-open URL`
|
165
186
|
|
166
187
|
Specifies a resource to be opened when the user clicks the notification. This
|
@@ -10,7 +10,7 @@ def filename
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def zipfile
|
13
|
-
"#{
|
13
|
+
"#{version}.zip"
|
14
14
|
end
|
15
15
|
|
16
16
|
task :clean do
|
@@ -21,14 +21,18 @@ end
|
|
21
21
|
desc "Fetch latest build from the GitHub releases"
|
22
22
|
task :update_build do
|
23
23
|
unless File.exist?(zipfile)
|
24
|
-
sh "curl -L -O 'https://github.com/alloy/terminal-notifier/
|
24
|
+
sh "curl -L -O 'https://github.com/alloy/terminal-notifier/archive/#{zipfile}'"
|
25
25
|
end
|
26
26
|
|
27
27
|
rm_rf "vendor"
|
28
28
|
mkdir "vendor"
|
29
29
|
|
30
30
|
sh "unzip -o -d vendor #{zipfile}"
|
31
|
-
mv "vendor/#{filename}",
|
31
|
+
mv "vendor/#{filename}", 'vendor/terminal-notifier'
|
32
|
+
|
33
|
+
%x(xcodebuild -project '../Terminal\ Notifier.xcodeproj' -target terminal-notifier SYMROOT=build -verbose)
|
34
|
+
mv '../build/Release/terminal-notifier.app', 'vendor/terminal-notifier/'
|
35
|
+
chmod 0755, 'vendor/terminal-notifier/terminal-notifier.app/Contents/MacOS/terminal-notifier'
|
32
36
|
end
|
33
37
|
|
34
38
|
desc "Build gem"
|
@@ -9,6 +9,8 @@ NSString * const NotificationCenterUIBundleID = @"com.apple.notificationcenterui
|
|
9
9
|
#define NSAppKitVersionNumber10_8 1187
|
10
10
|
#define NSAppKitVersionNumber10_9 1265
|
11
11
|
|
12
|
+
#define contains(str1, str2) ([str1 rangeOfString: str2 ].location != NSNotFound)
|
13
|
+
|
12
14
|
NSString *_fakeBundleIdentifier = nil;
|
13
15
|
|
14
16
|
@implementation NSBundle (FakeBundleIdentifier)
|
@@ -66,24 +68,21 @@ isMavericks()
|
|
66
68
|
|
67
69
|
+(void)initializeUserDefaults
|
68
70
|
{
|
69
|
-
|
71
|
+
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
70
72
|
|
71
|
-
|
72
|
-
|
73
|
+
// initialize the dictionary with default values depending on OS level
|
74
|
+
NSDictionary *appDefaults;
|
73
75
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
//10.8
|
82
|
-
appDefaults = @{@"": @"message"};
|
83
|
-
}
|
76
|
+
if (isMavericks()) {
|
77
|
+
//10.9
|
78
|
+
appDefaults = @{@"sender": @"com.apple.Terminal"};
|
79
|
+
} else {
|
80
|
+
//10.8
|
81
|
+
appDefaults = @{@"": @"message"};
|
82
|
+
}
|
84
83
|
|
85
|
-
|
86
|
-
|
84
|
+
// and set them appropriately
|
85
|
+
[defaults registerDefaults:appDefaults];
|
87
86
|
}
|
88
87
|
|
89
88
|
- (void)printHelpBanner;
|
@@ -113,6 +112,8 @@ isMavericks()
|
|
113
112
|
" Old notifications with the same ID will be removed.\n" \
|
114
113
|
" -activate ID The bundle identifier of the application to activate when the user clicks the notification.\n" \
|
115
114
|
" -sender ID The bundle identifier of the application that should be shown as the sender, including its icon.\n" \
|
115
|
+
" -appIcon URL The URL of a image to display instead of the application icon (Mavericks+ only)\n" \
|
116
|
+
" -contentImage URL The URL of a image to display attached to the notification (Mavericks+ only)\n" \
|
116
117
|
" -open URL The URL of a resource to open when the user clicks the notification.\n" \
|
117
118
|
" -execute COMMAND A shell command to perform when the user clicks the notification.\n" \
|
118
119
|
"\n" \
|
@@ -186,10 +187,12 @@ isMavericks()
|
|
186
187
|
|
187
188
|
if (message) {
|
188
189
|
NSMutableDictionary *options = [NSMutableDictionary dictionary];
|
189
|
-
if (defaults[@"activate"]) options[@"bundleID"]
|
190
|
-
if (defaults[@"group"]) options[@"groupID"]
|
191
|
-
if (defaults[@"execute"]) options[@"command"]
|
192
|
-
if (defaults[@"open"]) options[@"open"]
|
190
|
+
if (defaults[@"activate"]) options[@"bundleID"] = defaults[@"activate"];
|
191
|
+
if (defaults[@"group"]) options[@"groupID"] = defaults[@"group"];
|
192
|
+
if (defaults[@"execute"]) options[@"command"] = defaults[@"execute"];
|
193
|
+
if (defaults[@"open"]) options[@"open"] = [defaults[@"open"] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
194
|
+
if (defaults[@"appIcon"]) options[@"appIcon"] = defaults[@"appIcon"];
|
195
|
+
if (defaults[@"contentImage"]) options[@"contentImage"] = defaults[@"contentImage"];
|
193
196
|
|
194
197
|
[self deliverNotificationWithTitle:defaults[@"title"] ?: @"Terminal"
|
195
198
|
subtitle:subtitle
|
@@ -200,6 +203,15 @@ isMavericks()
|
|
200
203
|
}
|
201
204
|
}
|
202
205
|
|
206
|
+
- (NSImage*)getImageFromURL:(NSString *) url;
|
207
|
+
{
|
208
|
+
if(!contains(url, @"file://")){ // Prefix file:// if not present
|
209
|
+
url = [NSString stringWithFormat:@"%@%@", @"file://", url];
|
210
|
+
}
|
211
|
+
NSURL *imageURL = [NSURL URLWithString:url];
|
212
|
+
return [[NSImage alloc] initWithContentsOfURL:imageURL];
|
213
|
+
}
|
214
|
+
|
203
215
|
- (void)deliverNotificationWithTitle:(NSString *)title
|
204
216
|
subtitle:(NSString *)subtitle
|
205
217
|
message:(NSString *)message
|
@@ -215,6 +227,19 @@ isMavericks()
|
|
215
227
|
userNotification.informativeText = message;
|
216
228
|
userNotification.userInfo = options;
|
217
229
|
|
230
|
+
if(isMavericks()){
|
231
|
+
// Mavericks options
|
232
|
+
if(options[@"appIcon"]){
|
233
|
+
// replacement app icon
|
234
|
+
[userNotification setValue:[self getImageFromURL:options[@"appIcon"]] forKey:@"_identityImage"];
|
235
|
+
[userNotification setValue:@(true) forKey:@"_identityImageHasBorder"];
|
236
|
+
}
|
237
|
+
if(options[@"contentImage"]){
|
238
|
+
// content image
|
239
|
+
userNotification.contentImage = [self getImageFromURL:options[@"contentImage"]];
|
240
|
+
}
|
241
|
+
}
|
242
|
+
|
218
243
|
if (sound != nil) {
|
219
244
|
userNotification.soundName = [sound isEqualToString: @"default"] ? NSUserNotificationDefaultSoundName : sound ;
|
220
245
|
}
|
@@ -17,11 +17,11 @@
|
|
17
17
|
<key>CFBundlePackageType</key>
|
18
18
|
<string>APPL</string>
|
19
19
|
<key>CFBundleShortVersionString</key>
|
20
|
-
<string>1.
|
20
|
+
<string>1.6.0</string>
|
21
21
|
<key>CFBundleSignature</key>
|
22
22
|
<string>????</string>
|
23
23
|
<key>CFBundleVersion</key>
|
24
|
-
<string>
|
24
|
+
<string>11</string>
|
25
25
|
<key>LSMinimumSystemVersion</key>
|
26
26
|
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
27
27
|
<key>LSUIElement</key>
|
@@ -19,11 +19,11 @@
|
|
19
19
|
<key>CFBundlePackageType</key>
|
20
20
|
<string>APPL</string>
|
21
21
|
<key>CFBundleShortVersionString</key>
|
22
|
-
<string>1.
|
22
|
+
<string>1.6.0</string>
|
23
23
|
<key>CFBundleSignature</key>
|
24
24
|
<string>????</string>
|
25
25
|
<key>CFBundleVersion</key>
|
26
|
-
<string>
|
26
|
+
<string>11</string>
|
27
27
|
<key>DTCompiler</key>
|
28
28
|
<string>com.apple.compilers.llvm.clang.1_0</string>
|
29
29
|
<key>DTPlatformBuild</key>
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: terminal-notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eloy Duran
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bacon
|