-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
326 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Mac | ||
.DS_Store | ||
|
||
# Alfred | ||
prefs.plist |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,235 @@ | ||
<?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>az.gogamid.aerospace</string> | ||
<key>connections</key> | ||
<dict> | ||
<key>5571A44C-D107-43F7-8139-97F8FEE23248</key> | ||
<array> | ||
<dict> | ||
<key>destinationuid</key> | ||
<string>3E3CBCF0-0943-4DA8-8E16-D23C8457DC5A</string> | ||
<key>modifiers</key> | ||
<integer>0</integer> | ||
<key>modifiersubtext</key> | ||
<string></string> | ||
<key>vitoclose</key> | ||
<false/> | ||
</dict> | ||
</array> | ||
<key>A485572F-8F6B-4C39-BEB5-569BE66A8212</key> | ||
<array> | ||
<dict> | ||
<key>destinationuid</key> | ||
<string>5571A44C-D107-43F7-8139-97F8FEE23248</string> | ||
<key>modifiers</key> | ||
<integer>0</integer> | ||
<key>modifiersubtext</key> | ||
<string></string> | ||
<key>vitoclose</key> | ||
<false/> | ||
</dict> | ||
</array> | ||
</dict> | ||
<key>createdby</key> | ||
<string>Imron Gamidli</string> | ||
<key>description</key> | ||
<string>Aerospace Tiling Window Manager Extension for Alfred</string> | ||
<key>disabled</key> | ||
<false/> | ||
<key>name</key> | ||
<string>aerospace</string> | ||
<key>objects</key> | ||
<array> | ||
<dict> | ||
<key>config</key> | ||
<dict> | ||
<key>alfredfiltersresults</key> | ||
<false/> | ||
<key>alfredfiltersresultsmatchmode</key> | ||
<integer>0</integer> | ||
<key>argumenttreatemptyqueryasnil</key> | ||
<true/> | ||
<key>argumenttrimmode</key> | ||
<integer>0</integer> | ||
<key>argumenttype</key> | ||
<integer>0</integer> | ||
<key>escaping</key> | ||
<integer>102</integer> | ||
<key>keyword</key> | ||
<string>{var:aerospace_keyword}</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>fetching commands</string> | ||
<key>script</key> | ||
<string>python3 ./main.py $1 | ||
</string> | ||
<key>scriptargtype</key> | ||
<integer>1</integer> | ||
<key>scriptfile</key> | ||
<string></string> | ||
<key>subtext</key> | ||
<string></string> | ||
<key>title</key> | ||
<string>Type Aerospace Command</string> | ||
<key>type</key> | ||
<integer>11</integer> | ||
<key>withspace</key> | ||
<true/> | ||
</dict> | ||
<key>type</key> | ||
<string>alfred.workflow.input.scriptfilter</string> | ||
<key>uid</key> | ||
<string>A485572F-8F6B-4C39-BEB5-569BE66A8212</string> | ||
<key>version</key> | ||
<integer>3</integer> | ||
</dict> | ||
<dict> | ||
<key>config</key> | ||
<dict> | ||
<key>alignment</key> | ||
<integer>0</integer> | ||
<key>backgroundcolor</key> | ||
<string></string> | ||
<key>fadespeed</key> | ||
<integer>0</integer> | ||
<key>fillmode</key> | ||
<integer>0</integer> | ||
<key>font</key> | ||
<string></string> | ||
<key>ignoredynamicplaceholders</key> | ||
<false/> | ||
<key>largetypetext</key> | ||
<string>{query}</string> | ||
<key>textcolor</key> | ||
<string></string> | ||
<key>wrapat</key> | ||
<integer>50</integer> | ||
</dict> | ||
<key>type</key> | ||
<string>alfred.workflow.output.largetype</string> | ||
<key>uid</key> | ||
<string>3E3CBCF0-0943-4DA8-8E16-D23C8457DC5A</string> | ||
<key>version</key> | ||
<integer>3</integer> | ||
</dict> | ||
<dict> | ||
<key>config</key> | ||
<dict> | ||
<key>concurrently</key> | ||
<false/> | ||
<key>escaping</key> | ||
<integer>102</integer> | ||
<key>script</key> | ||
<string>aerospace {query}</string> | ||
<key>scriptargtype</key> | ||
<integer>0</integer> | ||
<key>scriptfile</key> | ||
<string></string> | ||
<key>type</key> | ||
<integer>11</integer> | ||
</dict> | ||
<key>type</key> | ||
<string>alfred.workflow.action.script</string> | ||
<key>uid</key> | ||
<string>5571A44C-D107-43F7-8139-97F8FEE23248</string> | ||
<key>version</key> | ||
<integer>2</integer> | ||
</dict> | ||
</array> | ||
<key>readme</key> | ||
<string># alfred-aerospace | ||
<!--toc:start--> | ||
- [alfred-aerospace](#alfred-aerospace) | ||
- [Usage](#usage) | ||
- [Contribution is needed](#contribution-is-needed) | ||
<!--toc:end--> | ||
Aerospace Tiling Window Manager Extension for Alfred | ||
## Usage | ||
![usage](./images/usage.png) | ||
Currently only commands which do not require options are working, such as: | ||
- flatten-workspace-tree | ||
- fullscreen | ||
- macos-native-fullscreen | ||
- reload-config | ||
- enable | ||
- close | ||
- close-all-but-current | ||
.... | ||
## Contribution is needed | ||
1. Read about [Script Filter](https://www.alfredapp.com/help/workflows/inputs/script-filter/?ref=blog.lorentzca.me) | ||
2. Modify [main.py](./main.py) file for command options</string> | ||
<key>uidata</key> | ||
<dict> | ||
<key>3E3CBCF0-0943-4DA8-8E16-D23C8457DC5A</key> | ||
<dict> | ||
<key>xpos</key> | ||
<real>525</real> | ||
<key>ypos</key> | ||
<real>365</real> | ||
</dict> | ||
<key>5571A44C-D107-43F7-8139-97F8FEE23248</key> | ||
<dict> | ||
<key>xpos</key> | ||
<real>290</real> | ||
<key>ypos</key> | ||
<real>365</real> | ||
</dict> | ||
<key>A485572F-8F6B-4C39-BEB5-569BE66A8212</key> | ||
<dict> | ||
<key>xpos</key> | ||
<real>80</real> | ||
<key>ypos</key> | ||
<real>365</real> | ||
</dict> | ||
</dict> | ||
<key>userconfigurationconfig</key> | ||
<array> | ||
<dict> | ||
<key>config</key> | ||
<dict> | ||
<key>default</key> | ||
<string>asp</string> | ||
<key>placeholder</key> | ||
<string>asp</string> | ||
<key>required</key> | ||
<true/> | ||
<key>trim</key> | ||
<true/> | ||
</dict> | ||
<key>description</key> | ||
<string>Trigger keyword for aerospace in Alfred!</string> | ||
<key>label</key> | ||
<string>Keyword</string> | ||
<key>type</key> | ||
<string>textfield</string> | ||
<key>variable</key> | ||
<string>aerospace_keyword</string> | ||
</dict> | ||
</array> | ||
<key>variablesdontexport</key> | ||
<array/> | ||
<key>version</key> | ||
<string>0.0.1</string> | ||
<key>webaddress</key> | ||
<string>https://github.com/gogamid/alfred-aerospace</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import json | ||
import sys | ||
|
||
csv_rows = [ | ||
("close", "Close the focused window"), | ||
( | ||
"close-all-windows-but-current", | ||
"On the focused workspace, close all windows but current", | ||
), | ||
( | ||
"debug-windows", | ||
"Interactive command to record Accessibility API debug information to create bug reports", | ||
), | ||
("enable", "Temporarily disable window management"), | ||
("flatten-workspace-tree", "Flatten the tree of currently focused workspace."), | ||
("focus", "Set focus to the nearest window in in the given direction."), | ||
("focus-monitor", "Focus monitor by relative direction, by order, or by pattern"), | ||
("fullscreen", "Toggle the fullscreen mode for the currently focused window"), | ||
( | ||
"join-with", | ||
"Put the currently focused window and the nearest node in the specified direction under a common parent container", | ||
), | ||
("layout", "Change layout of the focused window to the given layout"), | ||
( | ||
"list-apps", | ||
"Print the list of running applications that appears in the Dock and may have a user interface", | ||
), | ||
( | ||
"list-exec-env-vars", | ||
"List environment variables that exec-* commands and callbacks are run with", | ||
), | ||
("list-monitors", "Print monitors that satisfy conditions"), | ||
("list-windows", "Print windows that satisfy conditions"), | ||
("list-workspaces", "Print workspaces that satisfy conditions"), | ||
( | ||
"macos-native-fullscreen", | ||
"Toggle macOS fullscreen for the currently focused window", | ||
), | ||
("macos-native-minimize", "Toggle macOS minimize for the currently focused window"), | ||
("mode", "Activate the specified binding mode"), | ||
("move", "Move the window in the given direction"), | ||
( | ||
"move-node-to-monitor", | ||
"Move window to monitor targeted by relative direction, by order, or by pattern", | ||
), | ||
( | ||
"move-node-to-workspace", | ||
"Move currently focused window to the specified workspace", | ||
), | ||
( | ||
"move-workspace-to-monitor", | ||
"Move currently focused workspace to the next or previous monitor", | ||
), | ||
("reload-config", "Reload currently active config"), | ||
("resize", "Resize the currently focused window"), | ||
("split", "Split focused window"), | ||
("workspace", "Focus the specified workspace"), | ||
( | ||
"workspace-back-and-forth", | ||
"Switch between currently focused workspace and previously focused workspace back and forth", | ||
), | ||
] | ||
|
||
|
||
def generate_worflow_output(commands): | ||
return json.dumps( | ||
{ | ||
"items": [ | ||
{ | ||
"title": command, | ||
"subtitle": description, | ||
"arg": command, | ||
} | ||
for (command, description) in commands | ||
] | ||
}, | ||
ensure_ascii=False, | ||
) | ||
|
||
|
||
text = sys.argv[1] | ||
commands = [] | ||
for command, description in csv_rows: | ||
if text in command: | ||
commands.append((command, description)) | ||
print(generate_worflow_output(commands)) |