Skip to content

Commit 1805567

Browse files
Optional coloured background
1 parent c5af75f commit 1805567

File tree

3 files changed

+184
-29
lines changed

3 files changed

+184
-29
lines changed

Workflow/info.plist

Lines changed: 180 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,24 @@
3434
<false/>
3535
</dict>
3636
</array>
37+
<key>4FA4BCF1-5C8D-4966-9E92-83F294E721CA</key>
38+
<array>
39+
<dict>
40+
<key>destinationuid</key>
41+
<string>C4B6F70E-2BF5-47E8-9116-FA95E71931AA</string>
42+
<key>modifiers</key>
43+
<integer>0</integer>
44+
<key>modifiersubtext</key>
45+
<string></string>
46+
<key>vitoclose</key>
47+
<false/>
48+
</dict>
49+
</array>
3750
<key>5C5DFAFA-B4E7-4A90-990D-B9DB9703F9B8</key>
3851
<array>
3952
<dict>
4053
<key>destinationuid</key>
41-
<string>0C193D95-D63C-4AE9-A23C-6A05088FAB65</string>
54+
<string>90D69369-CC54-4310-A694-9CEC0C2CD34B</string>
4255
<key>modifiers</key>
4356
<integer>0</integer>
4457
<key>modifiersubtext</key>
@@ -60,7 +73,7 @@
6073
<false/>
6174
</dict>
6275
</array>
63-
<key>A6E73533-57E0-4781-8F3C-E21CB458E4C5</key>
76+
<key>90D69369-CC54-4310-A694-9CEC0C2CD34B</key>
6477
<array>
6578
<dict>
6679
<key>destinationuid</key>
@@ -69,6 +82,31 @@
6982
<integer>0</integer>
7083
<key>modifiersubtext</key>
7184
<string></string>
85+
<key>sourceoutputuid</key>
86+
<string>CE6EE70E-280C-4B94-89C7-4FC11027C401</string>
87+
<key>vitoclose</key>
88+
<false/>
89+
</dict>
90+
<dict>
91+
<key>destinationuid</key>
92+
<string>4FA4BCF1-5C8D-4966-9E92-83F294E721CA</string>
93+
<key>modifiers</key>
94+
<integer>0</integer>
95+
<key>modifiersubtext</key>
96+
<string></string>
97+
<key>vitoclose</key>
98+
<false/>
99+
</dict>
100+
</array>
101+
<key>A6E73533-57E0-4781-8F3C-E21CB458E4C5</key>
102+
<array>
103+
<dict>
104+
<key>destinationuid</key>
105+
<string>90D69369-CC54-4310-A694-9CEC0C2CD34B</string>
106+
<key>modifiers</key>
107+
<integer>0</integer>
108+
<key>modifiersubtext</key>
109+
<string></string>
72110
<key>vitoclose</key>
73111
<false/>
74112
</dict>
@@ -118,6 +156,33 @@
118156
<key>version</key>
119157
<integer>1</integer>
120158
</dict>
159+
<dict>
160+
<key>config</key>
161+
<dict>
162+
<key>concurrently</key>
163+
<false/>
164+
<key>escaping</key>
165+
<integer>102</integer>
166+
<key>script</key>
167+
<string>query="$1"
168+
convert -background $bgColour -font /Library/Fonts/SF-Pro-Display-Bold.otf -fill $colour -gravity "center" -size "256x256" caption:"$query" +repage -depth 8 "$output"
169+
170+
convert $output -matte mask.png \
171+
-compose DstIn -composite "$output"</string>
172+
<key>scriptargtype</key>
173+
<integer>1</integer>
174+
<key>scriptfile</key>
175+
<string></string>
176+
<key>type</key>
177+
<integer>5</integer>
178+
</dict>
179+
<key>type</key>
180+
<string>alfred.workflow.action.script</string>
181+
<key>uid</key>
182+
<string>0C193D95-D63C-4AE9-A23C-6A05088FAB65</string>
183+
<key>version</key>
184+
<integer>2</integer>
185+
</dict>
121186
<dict>
122187
<key>config</key>
123188
<dict>
@@ -165,27 +230,34 @@ set the clipboard to (read (POSIX file output) as {«class PNGf»})</string>
165230
<dict>
166231
<key>config</key>
167232
<dict>
168-
<key>concurrently</key>
233+
<key>conditions</key>
234+
<array>
235+
<dict>
236+
<key>inputstring</key>
237+
<string>{var:useBg}</string>
238+
<key>matchcasesensitive</key>
239+
<false/>
240+
<key>matchmode</key>
241+
<integer>5</integer>
242+
<key>matchstring</key>
243+
<string></string>
244+
<key>outputlabel</key>
245+
<string>Yes Background</string>
246+
<key>uid</key>
247+
<string>CE6EE70E-280C-4B94-89C7-4FC11027C401</string>
248+
</dict>
249+
</array>
250+
<key>elselabel</key>
251+
<string>No background</string>
252+
<key>hideelse</key>
169253
<false/>
170-
<key>escaping</key>
171-
<integer>102</integer>
172-
<key>script</key>
173-
<string>query="$1"
174-
175-
convert -background none -font /Library/Fonts/SF-Pro-Display-Bold.otf -fill $colour -gravity "center" -size "512x512" caption:"$query" +repage -depth 8 "$output"</string>
176-
<key>scriptargtype</key>
177-
<integer>1</integer>
178-
<key>scriptfile</key>
179-
<string></string>
180-
<key>type</key>
181-
<integer>5</integer>
182254
</dict>
183255
<key>type</key>
184-
<string>alfred.workflow.action.script</string>
256+
<string>alfred.workflow.utility.conditional</string>
185257
<key>uid</key>
186-
<string>0C193D95-D63C-4AE9-A23C-6A05088FAB65</string>
258+
<string>90D69369-CC54-4310-A694-9CEC0C2CD34B</string>
187259
<key>version</key>
188-
<integer>2</integer>
260+
<integer>1</integer>
189261
</dict>
190262
<dict>
191263
<key>config</key>
@@ -200,6 +272,30 @@ convert -background none -font /Library/Fonts/SF-Pro-Display-Bold.otf -fill $col
200272
<key>version</key>
201273
<integer>1</integer>
202274
</dict>
275+
<dict>
276+
<key>config</key>
277+
<dict>
278+
<key>concurrently</key>
279+
<false/>
280+
<key>escaping</key>
281+
<integer>102</integer>
282+
<key>script</key>
283+
<string>query="$1"
284+
convert -background none -font /Library/Fonts/SF-Pro-Display-Bold.otf -fill $colour -gravity "center" -size "256x256" caption:"$query" +repage -depth 8 "$output"</string>
285+
<key>scriptargtype</key>
286+
<integer>1</integer>
287+
<key>scriptfile</key>
288+
<string></string>
289+
<key>type</key>
290+
<integer>5</integer>
291+
</dict>
292+
<key>type</key>
293+
<string>alfred.workflow.action.script</string>
294+
<key>uid</key>
295+
<string>4FA4BCF1-5C8D-4966-9E92-83F294E721CA</string>
296+
<key>version</key>
297+
<integer>2</integer>
298+
</dict>
203299
<dict>
204300
<key>config</key>
205301
<dict>
@@ -249,7 +345,7 @@ Dependencies:
249345
Must install ImageMagick first - brew install imagemagick
250346
Must install SF-Pro-Display-Bold.otf from Apple - https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg
251347
252-
You can configure the icon colour as well as the location on disk where icons are generated (defaults to /tmp)
348+
You can configure the icon colour, adjust background settings as well as define the location on disk where icons are generated (defaults to /tmp)
253349
254350
There's 2 ways to run the workflow: Through the clipboard or through Alfred's Universal Actions.
255351
@@ -265,16 +361,16 @@ This workflow was adapted from work by Mark Gavin - https://labs.appligent.com/p
265361
<key>0C193D95-D63C-4AE9-A23C-6A05088FAB65</key>
266362
<dict>
267363
<key>xpos</key>
268-
<real>435</real>
364+
<real>750</real>
269365
<key>ypos</key>
270-
<real>340</real>
366+
<real>285</real>
271367
</dict>
272368
<key>26D2696E-1778-488C-A6C6-F359D94F221E</key>
273369
<dict>
274370
<key>xpos</key>
275-
<real>780</real>
371+
<real>1180</real>
276372
<key>ypos</key>
277-
<real>340</real>
373+
<real>365</real>
278374
</dict>
279375
<key>4E50EE8A-A0B7-4FEE-93FE-5F0EF7532709</key>
280376
<dict>
@@ -283,6 +379,13 @@ This workflow was adapted from work by Mark Gavin - https://labs.appligent.com/p
283379
<key>ypos</key>
284380
<real>445</real>
285381
</dict>
382+
<key>4FA4BCF1-5C8D-4966-9E92-83F294E721CA</key>
383+
<dict>
384+
<key>xpos</key>
385+
<real>755</real>
386+
<key>ypos</key>
387+
<real>415</real>
388+
</dict>
286389
<key>5C5DFAFA-B4E7-4A90-990D-B9DB9703F9B8</key>
287390
<dict>
288391
<key>xpos</key>
@@ -297,6 +400,13 @@ This workflow was adapted from work by Mark Gavin - https://labs.appligent.com/p
297400
<key>ypos</key>
298401
<real>280</real>
299402
</dict>
403+
<key>90D69369-CC54-4310-A694-9CEC0C2CD34B</key>
404+
<dict>
405+
<key>xpos</key>
406+
<real>475</real>
407+
<key>ypos</key>
408+
<real>385</real>
409+
</dict>
300410
<key>A6E73533-57E0-4781-8F3C-E21CB458E4C5</key>
301411
<dict>
302412
<key>xpos</key>
@@ -307,9 +417,9 @@ This workflow was adapted from work by Mark Gavin - https://labs.appligent.com/p
307417
<key>C4B6F70E-2BF5-47E8-9116-FA95E71931AA</key>
308418
<dict>
309419
<key>xpos</key>
310-
<real>655</real>
420+
<real>1055</real>
311421
<key>ypos</key>
312-
<real>370</real>
422+
<real>395</real>
313423
</dict>
314424
</dict>
315425
<key>userconfigurationconfig</key>
@@ -318,7 +428,7 @@ This workflow was adapted from work by Mark Gavin - https://labs.appligent.com/p
318428
<key>config</key>
319429
<dict>
320430
<key>default</key>
321-
<string>#00aeee</string>
431+
<string>#8BE9FD</string>
322432
<key>placeholder</key>
323433
<string></string>
324434
<key>required</key>
@@ -327,21 +437,63 @@ This workflow was adapted from work by Mark Gavin - https://labs.appligent.com/p
327437
<true/>
328438
</dict>
329439
<key>description</key>
330-
<string>Choose colour for icons. Accepts hex: #52f97b or RGB: rgb(82, 249, 123)</string>
440+
<string>Accepts hex: #52f97b or RGB: rgb(82, 249, 123)</string>
331441
<key>label</key>
332442
<string>Colour</string>
333443
<key>type</key>
334444
<string>textfield</string>
335445
<key>variable</key>
336446
<string>colour</string>
337447
</dict>
448+
<dict>
449+
<key>config</key>
450+
<dict>
451+
<key>default</key>
452+
<false/>
453+
<key>required</key>
454+
<false/>
455+
<key>text</key>
456+
<string></string>
457+
</dict>
458+
<key>description</key>
459+
<string></string>
460+
<key>label</key>
461+
<string>Use Background?</string>
462+
<key>type</key>
463+
<string>checkbox</string>
464+
<key>variable</key>
465+
<string>useBg</string>
466+
</dict>
467+
<dict>
468+
<key>config</key>
469+
<dict>
470+
<key>default</key>
471+
<string>#6272A4</string>
472+
<key>placeholder</key>
473+
<string></string>
474+
<key>required</key>
475+
<false/>
476+
<key>trim</key>
477+
<true/>
478+
</dict>
479+
<key>description</key>
480+
<string>Accepts hex: #52f97b or RGB: rgb(82, 249, 123)</string>
481+
<key>label</key>
482+
<string>Background Colour</string>
483+
<key>type</key>
484+
<string>textfield</string>
485+
<key>variable</key>
486+
<string>bgColour</string>
487+
</dict>
338488
<dict>
339489
<key>config</key>
340490
<dict>
341491
<key>default</key>
342492
<string>/tmp</string>
343493
<key>filtermode</key>
344494
<integer>1</integer>
495+
<key>placeholder</key>
496+
<string></string>
345497
<key>required</key>
346498
<true/>
347499
</dict>
@@ -358,7 +510,7 @@ This workflow was adapted from work by Mark Gavin - https://labs.appligent.com/p
358510
<key>variablesdontexport</key>
359511
<array/>
360512
<key>version</key>
361-
<string>0.1.1</string>
513+
<string>0.2.0</string>
362514
<key>webaddress</key>
363515
<string>https://github.com/NeighNeighNeigh/Alfred_IconGenerator</string>
364516
</dict>

Workflow/mask.png

16.3 KB
Loading

Workflow/prefs.plist

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
4-
<dict/>
4+
<dict>
5+
<key>useBg</key>
6+
<true/>
7+
</dict>
58
</plist>

0 commit comments

Comments
 (0)