Skip to content

Commit

Permalink
Fix the problem of Alfred workflow. #484
Browse files Browse the repository at this point in the history
  • Loading branch information
oldj committed Aug 27, 2020
1 parent fc65507 commit 0857af5
Show file tree
Hide file tree
Showing 19 changed files with 2,067 additions and 1,196 deletions.
12 changes: 7 additions & 5 deletions scripts/alfred/alfred.py → alfred/alfred.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ def main(wf):
# the list of results for Alfred
for item in items:
on = item.get('on', False)
wf.add_item(title=item['title'],
subtitle=get_subtitle(item),
arg=item['id'],
valid=True,
icon='on.png' if on else 'off.png')
wf.add_item(
title=item.get('title', 'untitled'),
subtitle=get_subtitle(item),
arg=item.get('id'),
valid=True,
icon='on.png' if on else 'off.png',
)

# Send the results to Alfred as XML
wf.send_feedback()
Expand Down
Binary file added alfred/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
124 changes: 124 additions & 0 deletions alfred/info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?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>switchhosts.oldj.net</string>
<key>category</key>
<string>Productivity</string>
<key>connections</key>
<dict>
<key>E4D66445-FD72-47A2-9EE6-7232A2BADE29</key>
<array>
<dict>
<key>destinationuid</key>
<string>78D17FD5-9628-4901-A01A-511528D5FC14</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
</dict>
<key>createdby</key>
<string>oldj</string>
<key>description</key>
<string>SwitchHosts quickly!</string>
<key>disabled</key>
<false/>
<key>name</key>
<string>SwitchHosts!</string>
<key>objects</key>
<array>
<dict>
<key>config</key>
<dict>
<key>concurrently</key>
<false/>
<key>escaping</key>
<integer>102</integer>
<key>script</key>
<string>curl 'http://127.0.0.1:50761/api/toggle?id={query}'</string>
<key>scriptargtype</key>
<integer>0</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>78D17FD5-9628-4901-A01A-511528D5FC14</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>alfredfiltersresults</key>
<false/>
<key>argumenttype</key>
<integer>2</integer>
<key>escaping</key>
<integer>68</integer>
<key>keyword</key>
<string>swh</string>
<key>queuedelaycustom</key>
<integer>3</integer>
<key>queuedelayimmediatelyinitially</key>
<true/>
<key>queuedelaymode</key>
<integer>0</integer>
<key>queuemode</key>
<integer>1</integer>
<key>runningsubtext</key>
<string>loading...</string>
<key>script</key>
<string>python alfred.py</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
<string></string>
<key>subtext</key>
<string>Switch hosts quickly!</string>
<key>title</key>
<string>Show hosts..</string>
<key>type</key>
<integer>0</integer>
<key>withspace</key>
<false/>
</dict>
<key>type</key>
<string>alfred.workflow.input.scriptfilter</string>
<key>uid</key>
<string>E4D66445-FD72-47A2-9EE6-7232A2BADE29</string>
<key>version</key>
<integer>2</integer>
</dict>
</array>
<key>readme</key>
<string></string>
<key>uidata</key>
<dict>
<key>78D17FD5-9628-4901-A01A-511528D5FC14</key>
<dict>
<key>xpos</key>
<integer>340</integer>
<key>ypos</key>
<integer>30</integer>
</dict>
<key>E4D66445-FD72-47A2-9EE6-7232A2BADE29</key>
<dict>
<key>xpos</key>
<integer>120</integer>
<key>ypos</key>
<integer>30</integer>
</dict>
</dict>
<key>webaddress</key>
<string>https://oldj.github.io/SwitchHosts/</string>
</dict>
</plist>
File renamed without changes
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Workflow objects
from .workflow import Workflow, manager
from .workflow3 import Workflow3
from .workflow3 import Variables, Workflow3

# Exceptions
from .workflow import PasswordNotFound, KeychainError
Expand Down Expand Up @@ -64,9 +64,10 @@
__version__ = open(os.path.join(os.path.dirname(__file__), 'version')).read()
__author__ = 'Dean Jackson'
__licence__ = 'MIT'
__copyright__ = 'Copyright 2014 Dean Jackson'
__copyright__ = 'Copyright 2014-2019 Dean Jackson'

__all__ = [
'Variables',
'Workflow',
'Workflow3',
'manager',
Expand Down
Loading

0 comments on commit 0857af5

Please sign in to comment.