-
Notifications
You must be signed in to change notification settings - Fork 0
/
info.plist
435 lines (422 loc) · 12.1 KB
/
info.plist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>bundleid</key>
<string>fm.steno.alfred</string>
<key>category</key>
<string>Tools</string>
<key>connections</key>
<dict>
<key>1908569A-829D-4A98-AB41-53065986578D</key>
<array>
<dict>
<key>destinationuid</key>
<string>1B32E452-E22C-43CC-A2E5-AFC7A84EFC1D</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>1B32E452-E22C-43CC-A2E5-AFC7A84EFC1D</key>
<array>
<dict>
<key>destinationuid</key>
<string>B01CE81A-CB9B-472B-B561-63640E98431D</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>4AB7BC00-5DC5-47E9-9686-6A0EE5B84899</key>
<array>
<dict>
<key>destinationuid</key>
<string>27B3AC08-E660-4BD0-8363-042150A31DD9</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
<dict>
<key>destinationuid</key>
<string>1908569A-829D-4A98-AB41-53065986578D</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>B01CE81A-CB9B-472B-B561-63640E98431D</key>
<array>
<dict>
<key>destinationuid</key>
<string>22C16424-ED75-4099-8AD4-4643CBD26E34</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>B4EECEF6-1DE8-4AF8-B223-966B729CB1C7</key>
<array>
<dict>
<key>destinationuid</key>
<string>1908569A-829D-4A98-AB41-53065986578D</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
</dict>
<key>createdby</key>
<string>Nathan Gathright</string>
<key>description</key>
<string>Search for podcasts on Steno.fm from Alfred</string>
<key>disabled</key>
<false/>
<key>name</key>
<string>Steno.fm</string>
<key>objects</key>
<array>
<dict>
<key>config</key>
<dict>
<key>concurrently</key>
<false/>
<key>escaping</key>
<integer>0</integer>
<key>script</key>
<string># THESE VARIABLES MUST BE SET. SEE THE ONEUPDATER README FOR AN EXPLANATION OF EACH.
readonly remote_info_plist=''
readonly workflow_url='nathangathright/alfred-steno'
readonly download_type='github_release'
readonly frequency_check='0'
# FROM HERE ON, CODE SHOULD BE LEFT UNTOUCHED!
function abort {
echo "${1}" >&2
exit 1
}
function url_exists {
curl --silent --location --output /dev/null --fail --range 0-0 "${1}"
}
function notification {
local -r notificator="$(find . -type d -name 'Notificator.app')"
if [[ -n "${notificator}" ]]; then
"${notificator}/Contents/Resources/Scripts/notificator" --message "${1}" --title "${alfred_workflow_name}" --subtitle 'A new version is available'
return
fi
local -r terminal_notifier="$(find . -type f -name 'terminal-notifier')"
if [[ -n "${terminal_notifier}" ]]; then
"${terminal_notifier}" -title "${alfred_workflow_name}" -subtitle 'A new version is available' -message "${1}"
return
fi
osascript -e "display notification \"${1}\" with title \"${alfred_workflow_name}\" subtitle \"A new version is available\""
}
# Local sanity checks
readonly local_info_plist='info.plist'
readonly local_version="$(/usr/libexec/PlistBuddy -c 'print version' "${local_info_plist}")"
[[ -n "${local_version}" ]] || abort 'You need to set a workflow version in the configuration sheet.'
[[ "${download_type}" =~ ^(direct|page|github_release)$ ]] || abort "'download_type' (${download_type}) needs to be one of 'direct', 'page', or 'github_release'."
[[ "${frequency_check}" =~ ^[0-9]+$ ]] || abort "'frequency_check' (${frequency_check}) needs to be a number."
# Check for updates
if [[ $(find "${local_info_plist}" -mtime +"${frequency_check}"d) ]]; then
if ! url_exists "${remote_info_plist}"; then abort "'remote_info_plist' (${remote_info_plist}) appears to not be reachable."; fi # Remote sanity check
readonly tmp_file="$(mktemp)"
curl --silent --location --output "${tmp_file}" "${remote_info_plist}"
readonly remote_version="$(/usr/libexec/PlistBuddy -c 'print version' "${tmp_file}")"
if [[ "${local_version}" == "${remote_version}" ]]; then
touch "${local_info_plist}" # Reset timer by touching local file
exit 0
fi
if [[ "${download_type}" == 'page' ]]; then
notification 'Opening download page…'
open "${workflow_url}"
exit 0
fi
download_url="$([[ "${download_type}" == 'github_release' ]] && curl --silent "https://api.github.com/repos/${workflow_url}/releases/latest" | grep 'browser_download_url' | head -1 | sed -E 's/.*browser_download_url": "(.*)"/\1/' || echo "${workflow_url}")"
if url_exists "${download_url}"; then
notification 'Downloading and installing…'
curl --silent --location --output "${HOME}/Downloads/${alfred_workflow_name}.alfredworkflow" "${download_url}"
open "${HOME}/Downloads/${alfred_workflow_name}.alfredworkflow"
else
abort "'workflow_url' (${download_url}) appears to not be reachable."
fi
fi</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
<string></string>
<key>type</key>
<integer>0</integer>
</dict>
<key>type</key>
<string>alfred.workflow.action.script</string>
<key>uid</key>
<string>27B3AC08-E660-4BD0-8363-042150A31DD9</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>alfredfiltersresults</key>
<false/>
<key>alfredfiltersresultsmatchmode</key>
<integer>0</integer>
<key>argumenttreatemptyqueryasnil</key>
<false/>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
<integer>0</integer>
<key>escaping</key>
<integer>102</integer>
<key>keyword</key>
<string>steno</string>
<key>queuedelaycustom</key>
<integer>3</integer>
<key>queuedelayimmediatelyinitially</key>
<true/>
<key>queuedelaymode</key>
<integer>0</integer>
<key>queuemode</key>
<integer>2</integer>
<key>runningsubtext</key>
<string>Searching…</string>
<key>script</key>
<string>./node_modules/.bin/run-node search.js "$1"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
<string>index.js</string>
<key>subtext</key>
<string></string>
<key>title</key>
<string>Search steno.fm for '{query}'</string>
<key>type</key>
<integer>0</integer>
<key>withspace</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.input.scriptfilter</string>
<key>uid</key>
<string>4AB7BC00-5DC5-47E9-9686-6A0EE5B84899</string>
<key>version</key>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>browser</key>
<string></string>
<key>spaces</key>
<string></string>
<key>url</key>
<string>{query}</string>
<key>utf8</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.action.openurl</string>
<key>uid</key>
<string>22C16424-ED75-4099-8AD4-4643CBD26E34</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
<integer>2</integer>
<key>fixedorder</key>
<false/>
<key>items</key>
<string>[{"title":"Open in production","arg":"https:\/\/steno.fm\/show\/{var:split1}","subtitle":"https:\/\/steno.fm\/show\/{var:split1}"},{"imagefile":"icon-dev.png","title":"Open in development","arg":"{var:development}\/show\/{var:split1}","subtitle":"{var:development}\/show\/{var:split1}"},{"imagefile":"icon-rss.png","title":"Open RSS feed","arg":"{var:split2}","subtitle":"{var:split2}"}]</string>
<key>runningsubtext</key>
<string></string>
<key>subtext</key>
<string></string>
<key>title</key>
<string></string>
<key>withspace</key>
<false/>
</dict>
<key>type</key>
<string>alfred.workflow.input.listfilter</string>
<key>uid</key>
<string>B01CE81A-CB9B-472B-B561-63640E98431D</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>argument</key>
<string></string>
<key>passthroughargument</key>
<false/>
<key>variables</key>
<dict/>
</dict>
<key>type</key>
<string>alfred.workflow.utility.argument</string>
<key>uid</key>
<string>1B32E452-E22C-43CC-A2E5-AFC7A84EFC1D</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>delimiter</key>
<string>,</string>
<key>trimarguments</key>
<true/>
<key>variableprefix</key>
<string>split</string>
</dict>
<key>type</key>
<string>alfred.workflow.utility.split</string>
<key>uid</key>
<string>1908569A-829D-4A98-AB41-53065986578D</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>alfredfiltersresults</key>
<false/>
<key>alfredfiltersresultsmatchmode</key>
<integer>0</integer>
<key>argumenttreatemptyqueryasnil</key>
<false/>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
<integer>0</integer>
<key>escaping</key>
<integer>102</integer>
<key>keyword</key>
<string>feed</string>
<key>queuedelaycustom</key>
<integer>3</integer>
<key>queuedelayimmediatelyinitially</key>
<true/>
<key>queuedelaymode</key>
<integer>0</integer>
<key>queuemode</key>
<integer>2</integer>
<key>runningsubtext</key>
<string>Searching…</string>
<key>script</key>
<string>./node_modules/.bin/run-node feed.js "$1"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
<string>index.js</string>
<key>subtext</key>
<string></string>
<key>title</key>
<string>Search steno.fm for '{query}'</string>
<key>type</key>
<integer>0</integer>
<key>withspace</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.input.scriptfilter</string>
<key>uid</key>
<string>B4EECEF6-1DE8-4AF8-B223-966B729CB1C7</string>
<key>version</key>
<integer>3</integer>
</dict>
</array>
<key>readme</key>
<string></string>
<key>uidata</key>
<dict>
<key>1908569A-829D-4A98-AB41-53065986578D</key>
<dict>
<key>xpos</key>
<integer>310</integer>
<key>ypos</key>
<integer>200</integer>
</dict>
<key>1B32E452-E22C-43CC-A2E5-AFC7A84EFC1D</key>
<dict>
<key>xpos</key>
<integer>395</integer>
<key>ypos</key>
<integer>200</integer>
</dict>
<key>22C16424-ED75-4099-8AD4-4643CBD26E34</key>
<dict>
<key>xpos</key>
<integer>635</integer>
<key>ypos</key>
<integer>170</integer>
</dict>
<key>27B3AC08-E660-4BD0-8363-042150A31DD9</key>
<dict>
<key>colorindex</key>
<integer>12</integer>
<key>note</key>
<string>OneUpdater</string>
<key>xpos</key>
<integer>495</integer>
<key>ypos</key>
<integer>60</integer>
</dict>
<key>4AB7BC00-5DC5-47E9-9686-6A0EE5B84899</key>
<dict>
<key>xpos</key>
<integer>45</integer>
<key>ypos</key>
<integer>60</integer>
</dict>
<key>B01CE81A-CB9B-472B-B561-63640E98431D</key>
<dict>
<key>xpos</key>
<integer>495</integer>
<key>ypos</key>
<integer>170</integer>
</dict>
<key>B4EECEF6-1DE8-4AF8-B223-966B729CB1C7</key>
<dict>
<key>xpos</key>
<integer>45</integer>
<key>ypos</key>
<integer>275</integer>
</dict>
</dict>
<key>variables</key>
<dict>
<key>development</key>
<string>http://localhost:3000</string>
</dict>
<key>version</key>
<string>0.0.4</string>
<key>webaddress</key>
<string>https://github.com/nathangathright/alfred-steno</string>
</dict>
</plist>