From 783dae4a077c22f23a95b945afbe4e6f5bfc0352 Mon Sep 17 00:00:00 2001 From: "Mr. Pennyworth" Date: Tue, 20 Feb 2024 09:21:43 -0600 Subject: [PATCH] Add .dict-css to open the stylesheet A user can type `.dict-css` in Alfred and open the stylesheet that controls the appearance of the dictionary entries. --- info.plist | 331 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 218 insertions(+), 113 deletions(-) diff --git a/info.plist b/info.plist index fe86e53..8aeb3fc 100644 --- a/info.plist +++ b/info.plist @@ -34,6 +34,19 @@ + 20D38440-F936-46C0-B86E-DBD7028AFDB7 + + + destinationuid + 7D522442-A9A5-4103-AC3E-5373DB98AC9F + modifiers + 0 + modifiersubtext + + vitoclose + + + 29F7F338-2B96-43C0-A429-19810757504C @@ -176,6 +189,30 @@ Better Dictionaries objects + + config + + concurrently + + escaping + 102 + script + query=$1 +/sayipa "$query" + scriptargtype + 1 + scriptfile + sayipa.sh + type + 8 + + type + alfred.workflow.action.script + uid + 4304F5B0-5EE4-4190-8C7A-3D3BF945DBD9 + version + 2 + config @@ -210,42 +247,52 @@ config - concurrently + conditions + + + inputstring + {var:dict_id} + matchcasesensitive + + matchmode + 0 + matchstring + dummy + outputlabel + dummy-dummy-dummy-dummy + uid + 92307DED-E117-458E-BCD0-06C64248AB1F + + + elselabel + else + hideelse - escaping - 102 - script - query=$1 -/sayipa "$query" - scriptargtype - 1 - scriptfile - sayipa.sh - type - 8 type - alfred.workflow.action.script + alfred.workflow.utility.conditional uid - 4304F5B0-5EE4-4190-8C7A-3D3BF945DBD9 + F7170828-96FA-4241-A50B-974496E7A1FC version - 2 + 1 config alfredfiltersresults - + alfredfiltersresultsmatchmode - 1 + 2 argumenttreatemptyqueryasnil argumenttrimmode 0 argumenttype - 0 + 1 escaping 102 + keyword + lookup queuedelaycustom 3 queuedelayimmediatelyinitially @@ -255,26 +302,26 @@ queuemode 2 runningsubtext - + loading... script - + cat "$alfred_workflow_data/imported.json" scriptargtype 1 scriptfile subtext - + keywoard: 'lookup' title - dummy + Look a word up in a BetterDictionary type 0 withspace - + type alfred.workflow.input.scriptfilter uid - CE509E43-D9A7-4B99-AFA6-6FEEB4D26442 + 18D17FBB-4E03-4E94-9802-19E31E8C516C version 3 @@ -282,19 +329,17 @@ config alfredfiltersresults - + alfredfiltersresultsmatchmode - 2 + 1 argumenttreatemptyqueryasnil argumenttrimmode 0 argumenttype - 1 + 0 escaping 102 - keyword - lookup queuedelaycustom 3 queuedelayimmediatelyinitially @@ -304,61 +349,29 @@ queuemode 2 runningsubtext - loading... + script - cat "$alfred_workflow_data/imported.json" + scriptargtype 1 scriptfile subtext - keywoard: 'lookup' + title - Look a word up in a BetterDictionary + dummy type 0 withspace - + type alfred.workflow.input.scriptfilter uid - 18D17FBB-4E03-4E94-9802-19E31E8C516C + CE509E43-D9A7-4B99-AFA6-6FEEB4D26442 version 3 - - config - - conditions - - - inputstring - {var:dict_id} - matchcasesensitive - - matchmode - 0 - matchstring - dummy - outputlabel - dummy-dummy-dummy-dummy - uid - 92307DED-E117-458E-BCD0-06C64248AB1F - - - elselabel - else - hideelse - - - type - alfred.workflow.utility.conditional - uid - F7170828-96FA-4241-A50B-974496E7A1FC - version - 1 - config @@ -402,6 +415,41 @@ version 3 + + config + + concurrently + + escaping + 102 + script + function confirm() { +./cocoadialog.app/Contents/MacOS/cocoaDialog \ + yesno-msgbox \ + --no-cancel \ + --title 'Factory Reset BetterDict' \ + --label 'This will delete the HTML previews and search index. You can re-import the dictionaries later.' \ + --alert 'Do you really want to delete all imported dictionaries?' +} + +if [ "$(confirm)" = "1" ]; then + killall alfred-dict-server + ./BetterDict factoryReset "$alfred_workflow_data" +fi + scriptargtype + 1 + scriptfile + + type + 0 + + type + alfred.workflow.action.script + uid + 402C89C1-C3F3-4786-9683-19ACD884E06E + version + 2 + config @@ -431,19 +479,9 @@ escaping 102 script - function confirm() { -./cocoadialog.app/Contents/MacOS/cocoaDialog \ - yesno-msgbox \ - --no-cancel \ - --title 'Factory Reset BetterDict' \ - --label 'This will delete the HTML previews and search index. You can re-import the dictionaries later.' \ - --alert 'Do you really want to delete all imported dictionaries?' -} + query=$1 -if [ "$(confirm)" = "1" ]; then - killall alfred-dict-server - ./BetterDict factoryReset "$alfred_workflow_data" -fi +./BetterDict import "$query" "$alfred_workflow_data" scriptargtype 1 scriptfile @@ -454,7 +492,7 @@ fi type alfred.workflow.action.script uid - 402C89C1-C3F3-4786-9683-19ACD884E06E + 29F7F338-2B96-43C0-A429-19810757504C version 2 @@ -507,31 +545,6 @@ fi version 3 - - config - - concurrently - - escaping - 102 - script - query=$1 - -./BetterDict import "$query" "$alfred_workflow_data" - scriptargtype - 1 - scriptfile - - type - 0 - - type - alfred.workflow.action.script - uid - 29F7F338-2B96-43C0-A429-19810757504C - version - 2 - config @@ -613,6 +626,27 @@ END version 1 + + config + + argumenttype + 2 + keyword + .dict-data + subtext + keywoard: '.dict-data' + text + Open Dictionary Data Folder + withspace + + + type + alfred.workflow.input.keyword + uid + 5F2298EA-894F-4017-BD87-6120B0E7FFF6 + version + 1 + config @@ -645,23 +679,80 @@ open "$DIR" config + openwith + + sourcefile + + + type + alfred.workflow.action.openfile + uid + 7D522442-A9A5-4103-AC3E-5373DB98AC9F + version + 3 + + + config + + alfredfiltersresults + + alfredfiltersresultsmatchmode + 0 + argumenttreatemptyqueryasnil + + argumenttrimmode + 0 argumenttype 2 + escaping + 102 keyword - .dict-data + .dict-css + queuedelaycustom + 3 + queuedelayimmediatelyinitially + + queuedelaymode + 0 + queuemode + 1 + runningsubtext + + script + cat <<EOF +{"items": [ + { + "uid": "desktop", + "type": "file", + "title": "dict-entry.css", + "arg": "dict-entry.css", + "autocomplete": "dict-entry.css", + "icon": { + "type": "fileicon", + "path": "dict-entry.css" + } + } +]} +EOF + scriptargtype + 1 + scriptfile + subtext - keywoard: '.dict-data' - text - Open Dictionary Data Folder + edit this file to change Better Dictionaries appearance + title + Better Dictionaries Stylesheet + type + 11 withspace type - alfred.workflow.input.keyword + alfred.workflow.input.scriptfilter uid - 5F2298EA-894F-4017-BD87-6120B0E7FFF6 + 20D38440-F936-46C0-B86E-DBD7028AFDB7 version - 1 + 3 readme @@ -710,6 +801,13 @@ Subsequent searches should be snappy ypos 500 + 20D38440-F936-46C0-B86E-DBD7028AFDB7 + + xpos + 30 + ypos + 770 + 29F7F338-2B96-43C0-A429-19810757504C xpos @@ -765,6 +863,13 @@ Subsequent searches should be snappy ypos 15 + 7D522442-A9A5-4103-AC3E-5373DB98AC9F + + xpos + 185 + ypos + 770 + 96B75A90-A8B0-4B61-85E7-91F01F0835E3 note @@ -833,7 +938,7 @@ Subsequent searches should be snappy variablesdontexport version - 0.2.3 + 0.2.4 webaddress https://github.com/mr-pennyworth/alfred-better-dictionaries