-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
info.plist
399 lines (373 loc) · 11.2 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
<?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>com.wrjlewis.notion-search</string>
<key>connections</key>
<dict>
<key>7DD3BDE5-A157-42E5-9376-F681FB50A4EE</key>
<array>
<dict>
<key>destinationuid</key>
<string>FCE03E9D-F992-4B21-9A77-E72D5130DF80</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
<dict>
<key>destinationuid</key>
<string>C4564BA3-C023-400E-AA4E-726CC734C91D</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
<dict>
<key>destinationuid</key>
<string>2A617635-BC53-4025-A598-0A8B1E6C434B</string>
<key>modifiers</key>
<integer>1048576</integer>
<key>modifiersubtext</key>
<string>Copy to clipboard</string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>F7D08518-1D55-4B69-AE6C-198FA8628A43</key>
<array>
<dict>
<key>destinationuid</key>
<string>0B599F73-39AE-445B-8B09-AA12331F953D</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
</dict>
<key>createdby</key>
<string>Will Lewis</string>
<key>description</key>
<string>Instant Notion Search</string>
<key>disabled</key>
<false/>
<key>name</key>
<string>Notion Search</string>
<key>objects</key>
<array>
<dict>
<key>config</key>
<dict>
<key>browser</key>
<string></string>
<key>spaces</key>
<string></string>
<key>url</key>
<string></string>
<key>utf8</key>
<false/>
</dict>
<key>type</key>
<string>alfred.workflow.action.openurl</string>
<key>uid</key>
<string>FCE03E9D-F992-4B21-9A77-E72D5130DF80</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>1</integer>
<key>escaping</key>
<integer>68</integer>
<key>keyword</key>
<string>ns</string>
<key>queuedelaycustom</key>
<integer>3</integer>
<key>queuedelayimmediatelyinitially</key>
<false/>
<key>queuedelaymode</key>
<integer>0</integer>
<key>queuemode</key>
<integer>1</integer>
<key>runningsubtext</key>
<string>Loading..</string>
<key>script</key>
<string>python3 notion.py "{query}"</string>
<key>scriptargtype</key>
<integer>0</integer>
<key>scriptfile</key>
<string>notion.py</string>
<key>subtext</key>
<string></string>
<key>title</key>
<string>Notion Search</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>7DD3BDE5-A157-42E5-9376-F681FB50A4EE</string>
<key>version</key>
<integer>3</integer>
</dict>
<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='https://raw.githubusercontent.com/wrjlewis/notion-search-alfred-workflow/master/info.plist'
readonly workflow_url='wrjlewis/notion-search-alfred-workflow'
readonly download_type='github_release'
readonly frequency_check='1'
# 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 f -name 'notificator')"
if [[ -f "${notificator}" && "$(/usr/bin/file --brief --mime-type "${notificator}")" == 'text/x-shellscript' ]]; then
"${notificator}" --message "${1}" --title "${alfred_workflow_name}" --subtitle 'A new version is available'
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
# Remote sanity check
if ! url_exists "${remote_info_plist}"; then
abort "'remote_info_plist' (${remote_info_plist}) appears to not be reachable."
fi
readonly tmp_file="$(mktemp)"
curl --silent --location --output "${tmp_file}" "${remote_info_plist}"
readonly remote_version="$(/usr/libexec/PlistBuddy -c 'print version' "${tmp_file}")"
rm "${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
readonly download_url="$(
if [[ "${download_type}" == 'github_release' ]]; then
osascript -l JavaScript -e 'function run(argv) { return JSON.parse(argv[0])["assets"].find(asset => asset["browser_download_url"].endsWith(".alfredworkflow"))["browser_download_url"] }' "$(curl --silent "https://api.github.com/repos/${workflow_url}/releases/latest")"
else
echo "${workflow_url}"
fi
)"
if url_exists "${download_url}"; then
notification 'Downloading and installing…'
readonly download_name="$(basename "${download_url}")"
curl --silent --location --output "${HOME}/Downloads/${download_name}" "${download_url}"
open "${HOME}/Downloads/${download_name}"
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>C4564BA3-C023-400E-AA4E-726CC734C91D</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>autopaste</key>
<false/>
<key>clipboardtext</key>
<string>{query}</string>
<key>ignoredynamicplaceholders</key>
<false/>
<key>transient</key>
<false/>
</dict>
<key>type</key>
<string>alfred.workflow.output.clipboard</string>
<key>uid</key>
<string>2A617635-BC53-4025-A598-0A8B1E6C434B</string>
<key>version</key>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>argumenttype</key>
<integer>2</integer>
<key>keyword</key>
<string>nsn</string>
<key>subtext</key>
<string></string>
<key>text</key>
<string>Open a new Notion page..</string>
<key>withspace</key>
<false/>
</dict>
<key>type</key>
<string>alfred.workflow.input.keyword</string>
<key>uid</key>
<string>F7D08518-1D55-4B69-AE6C-198FA8628A43</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>browser</key>
<string></string>
<key>spaces</key>
<string></string>
<key>url</key>
<string>https://notion.new</string>
<key>utf8</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.action.openurl</string>
<key>uid</key>
<string>0B599F73-39AE-445B-8B09-AA12331F953D</string>
<key>version</key>
<integer>1</integer>
</dict>
</array>
<key>readme</key>
<string>Latest updates in 0.6:
- Updated cairosvg installation instructions in the readme: run the provided commands in order to get svg icons working on apple silicon.
- Type ‘nsn’ for the option to quickly open a new page in Notion. Very handy! (This only works in the web app currently)
- https://github.com/wrjlewis/notion-search-alfred-workflow/issues/83 - Fixed a bug that would cause an error and no more results to be displayed when opening pages relating to new Notion projects and icons.
****** PLEASE NOTE ******
Alfred 5 download now available here:
https://github.com/wrjlewis/notion-search-alfred5-workflow/
Usual automatic updates will follow once you've updated to the Alfred 5 version of this workflow.
If you are on alfred 4, you do not need to do anything and updates will continue as usual.
---
notion-search-alfred-workflow
An Alfred workflow to search Notion.so with instant results
Simply type your keyword into Alfred (default: ns) to see instant search results from Notion that mimic the Quick Find function in the Notion webapp. Selecting a search result takes you to that page in Notion in your default web browser.
Documentation, instructions on workflow variables in the readme here:
https://github.com/wrjlewis/notion-search-alfred-workflow/
Forum topic:
https://www.alfredforum.com/topic/14451-notionso-instant-search-workflow/
Thanks!</string>
<key>uidata</key>
<dict>
<key>0B599F73-39AE-445B-8B09-AA12331F953D</key>
<dict>
<key>xpos</key>
<integer>255</integer>
<key>ypos</key>
<integer>480</integer>
</dict>
<key>2A617635-BC53-4025-A598-0A8B1E6C434B</key>
<dict>
<key>xpos</key>
<integer>260</integer>
<key>ypos</key>
<integer>330</integer>
</dict>
<key>7DD3BDE5-A157-42E5-9376-F681FB50A4EE</key>
<dict>
<key>xpos</key>
<real>50</real>
<key>ypos</key>
<real>50</real>
</dict>
<key>C4564BA3-C023-400E-AA4E-726CC734C91D</key>
<dict>
<key>colorindex</key>
<integer>12</integer>
<key>note</key>
<string>OneUpdater</string>
<key>xpos</key>
<real>255</real>
<key>ypos</key>
<real>175</real>
</dict>
<key>F7D08518-1D55-4B69-AE6C-198FA8628A43</key>
<dict>
<key>xpos</key>
<integer>65</integer>
<key>ypos</key>
<integer>480</integer>
</dict>
<key>FCE03E9D-F992-4B21-9A77-E72D5130DF80</key>
<dict>
<key>xpos</key>
<real>255</real>
<key>ypos</key>
<real>50</real>
</dict>
</dict>
<key>variables</key>
<dict>
<key>cookie</key>
<string></string>
<key>enableIcons</key>
<string>True</string>
<key>iconCacheDays</key>
<string>365</string>
<key>isNavigableOnly</key>
<string>False</string>
<key>notionSpaceId</key>
<string></string>
<key>showRecentlyViewedPages</key>
<string>True</string>
<key>useDesktopClient</key>
<string>False</string>
</dict>
<key>variablesdontexport</key>
<array>
<string>cookie</string>
<string>notionSpaceId</string>
</array>
<key>version</key>
<string>0.6-alfred4</string>
<key>webaddress</key>
<string>https://github.com/wrjlewis/notion-search-alfred-workflow/</string>
</dict>
</plist>