[alfred][hammerspoon] windoe management experimentation

pull/28/head
Alpha Chen 5 years ago
parent ff5dbc7112
commit a97af63f1b

@ -3,25 +3,30 @@ local smash = {"cmd", "alt", "ctrl", "shift"}
-- Window management -- Window management
function chunkc (args) -- TODO implement desktop and window gaps
hs.task.new("/usr/local/bin/chunkc", nil, args) hs.urlevent.bind("wm", function(eventName, params)
:start() local log = hs.logger.new("wm", "debug")
end
hs.hotkey.bind(mash, "left", function() local win = hs.window.focusedWindow() -- TODO figure out why focusedWindow doesn't work
chunkc({"tiling::window", "--warp", "west"}) -- local win = hs.window.frontmostWindow()
end) local f = win:frame()
hs.hotkey.bind(mash, "right", function() local screen = win:screen()
chunkc({"tiling::window", "--warp", "east"}) local max = screen:frame()
end)
hs.hotkey.bind(mash, "up", function() local t = {
chunkc({"tiling::window", "--warp", "north"}) left = function(f) return hs.layout.left50 end,
end) right = function(f) return hs.layout.right50 end,
hs.hotkey.bind(mash, "down", function() ne = function(f) return { 0.5, 0, 0.5, 0.5 } end,
chunkc({"tiling::window", "--warp", "south"}) nw = function(f) return { 0, 0, 0.5, 0.5 } end,
end) se = function(f) return { 0.5, 0.5, 0.5, 0.5 } end,
hs.hotkey.bind(mash, "z", function() sw = function(f) return { 0, 0.5, 0.5, 0.5 } end,
chunkc({"tiling::window", "--toggle", "fullscreen"}) max = function(f) return hs.layout.maximized end,
}
local unitRect = hs.geometry(t[params["layout"]](f))
local frame = unitRect:fromUnitRect(max)
win:setFrame(frame)
-- win:focus()
end) end)
hs.loadSpoon("ReloadConfiguration") hs.loadSpoon("ReloadConfiguration")

@ -0,0 +1,257 @@
<?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>dev.kejadlen.hammerspoon</string>
<key>category</key>
<string>Tools</string>
<key>connections</key>
<dict>
<key>3B186D08-EE0B-478D-94CF-DA1E9EBDA477</key>
<array>
<dict>
<key>destinationuid</key>
<string>01F0EFEF-6E0E-4B8F-8A96-25E48B5BF995</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>64E1CBFD-F669-470E-AF5D-A4C8E53A06E9</key>
<array>
<dict>
<key>destinationuid</key>
<string>01F0EFEF-6E0E-4B8F-8A96-25E48B5BF995</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>B179BB0D-FB64-4011-A70E-83A5530A4C19</key>
<array>
<dict>
<key>destinationuid</key>
<string>01F0EFEF-6E0E-4B8F-8A96-25E48B5BF995</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>B435EAE0-B272-46D0-986C-EB80EB34BD10</key>
<array>
<dict>
<key>destinationuid</key>
<string>01F0EFEF-6E0E-4B8F-8A96-25E48B5BF995</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
</dict>
<key>createdby</key>
<string>Alpha Chen</string>
<key>description</key>
<string></string>
<key>disabled</key>
<false/>
<key>name</key>
<string>hammerspoon</string>
<key>objects</key>
<array>
<dict>
<key>config</key>
<dict>
<key>argumenttype</key>
<integer>0</integer>
<key>keyword</key>
<string>wm</string>
<key>subtext</key>
<string></string>
<key>text</key>
<string>hammerspoon window manager</string>
<key>withspace</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.input.keyword</string>
<key>uid</key>
<string>B435EAE0-B272-46D0-986C-EB80EB34BD10</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>browser</key>
<string>org.hammerspoon.Hammerspoon</string>
<key>spaces</key>
<string></string>
<key>url</key>
<string>hammerspoon://wm?layout={query}</string>
<key>utf8</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.action.openurl</string>
<key>uid</key>
<string>01F0EFEF-6E0E-4B8F-8A96-25E48B5BF995</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>action</key>
<integer>0</integer>
<key>argument</key>
<integer>3</integer>
<key>argumenttext</key>
<string>left</string>
<key>focusedappvariable</key>
<false/>
<key>focusedappvariablename</key>
<string></string>
<key>hotkey</key>
<integer>123</integer>
<key>hotmod</key>
<integer>12320768</integer>
<key>hotstring</key>
<string>←</string>
<key>leftcursor</key>
<false/>
<key>modsmode</key>
<integer>0</integer>
<key>relatedAppsMode</key>
<integer>0</integer>
</dict>
<key>type</key>
<string>alfred.workflow.trigger.hotkey</string>
<key>uid</key>
<string>3B186D08-EE0B-478D-94CF-DA1E9EBDA477</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>action</key>
<integer>0</integer>
<key>argument</key>
<integer>3</integer>
<key>argumenttext</key>
<string>right</string>
<key>focusedappvariable</key>
<false/>
<key>focusedappvariablename</key>
<string></string>
<key>hotkey</key>
<integer>124</integer>
<key>hotmod</key>
<integer>12320768</integer>
<key>hotstring</key>
<string>→</string>
<key>leftcursor</key>
<false/>
<key>modsmode</key>
<integer>0</integer>
<key>relatedAppsMode</key>
<integer>0</integer>
</dict>
<key>type</key>
<string>alfred.workflow.trigger.hotkey</string>
<key>uid</key>
<string>64E1CBFD-F669-470E-AF5D-A4C8E53A06E9</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>action</key>
<integer>0</integer>
<key>argument</key>
<integer>3</integer>
<key>argumenttext</key>
<string>max</string>
<key>focusedappvariable</key>
<false/>
<key>focusedappvariablename</key>
<string></string>
<key>hotkey</key>
<integer>6</integer>
<key>hotmod</key>
<integer>1835008</integer>
<key>hotstring</key>
<string>Z</string>
<key>leftcursor</key>
<false/>
<key>modsmode</key>
<integer>0</integer>
<key>relatedAppsMode</key>
<integer>0</integer>
</dict>
<key>type</key>
<string>alfred.workflow.trigger.hotkey</string>
<key>uid</key>
<string>B179BB0D-FB64-4011-A70E-83A5530A4C19</string>
<key>version</key>
<integer>2</integer>
</dict>
</array>
<key>readme</key>
<string></string>
<key>uidata</key>
<dict>
<key>01F0EFEF-6E0E-4B8F-8A96-25E48B5BF995</key>
<dict>
<key>xpos</key>
<integer>365</integer>
<key>ypos</key>
<integer>35</integer>
</dict>
<key>3B186D08-EE0B-478D-94CF-DA1E9EBDA477</key>
<dict>
<key>xpos</key>
<integer>35</integer>
<key>ypos</key>
<integer>145</integer>
</dict>
<key>64E1CBFD-F669-470E-AF5D-A4C8E53A06E9</key>
<dict>
<key>xpos</key>
<integer>35</integer>
<key>ypos</key>
<integer>255</integer>
</dict>
<key>B179BB0D-FB64-4011-A70E-83A5530A4C19</key>
<dict>
<key>xpos</key>
<integer>35</integer>
<key>ypos</key>
<integer>365</integer>
</dict>
<key>B435EAE0-B272-46D0-986C-EB80EB34BD10</key>
<dict>
<key>xpos</key>
<integer>35</integer>
<key>ypos</key>
<integer>35</integer>
</dict>
</dict>
<key>webaddress</key>
<string>https://github.com/kejadlen/hammerspoon.alfredworkflow</string>
</dict>
</plist>
Loading…
Cancel
Save