Compare commits
No commits in common. "51433e6aca6139ef0f35556876833c5efae64e87" and "71a1a67f164e88ec61a500d8164a156a2734b93a" have entirely different histories.
51433e6aca
...
71a1a67f16
@ -27,7 +27,7 @@
|
|||||||
description = "Print this menu";
|
description = "Print this menu";
|
||||||
exec = ''
|
exec = ''
|
||||||
echo "Commands:"
|
echo "Commands:"
|
||||||
echo -n '${
|
echo -n ${
|
||||||
builtins.toJSON (
|
builtins.toJSON (
|
||||||
builtins.mapAttrs (s: value: value.description) self.devShells.${pkgs.system}.default.config.scripts
|
builtins.mapAttrs (s: value: value.description) self.devShells.${pkgs.system}.default.config.scripts
|
||||||
)
|
)
|
||||||
|
|||||||
@ -1,11 +1,4 @@
|
|||||||
return (function()
|
return (function()
|
||||||
local application = hs.application
|
|
||||||
local grid = hs.grid
|
|
||||||
local screen = hs.screen
|
|
||||||
local spaces = hs.spaces
|
|
||||||
local timer = hs.timer
|
|
||||||
local wf = hs.window.filter
|
|
||||||
|
|
||||||
spoon = {
|
spoon = {
|
||||||
name = "C3C Workspace";
|
name = "C3C Workspace";
|
||||||
version = "0.0.1";
|
version = "0.0.1";
|
||||||
@ -22,88 +15,43 @@ return (function()
|
|||||||
screen = "0F6BDB5B-840D-40BE-AAC9-B467A78E057A",
|
screen = "0F6BDB5B-840D-40BE-AAC9-B467A78E057A",
|
||||||
fullscreen = true,
|
fullscreen = true,
|
||||||
},
|
},
|
||||||
Cursor = {
|
|
||||||
desktop = 1,
|
|
||||||
screen = "B5A65BB6-E73E-4C3D-977C-33C86798AA5A",
|
|
||||||
fullscreen = true,
|
|
||||||
},
|
|
||||||
Spotify = {
|
|
||||||
desktop = 3,
|
|
||||||
screen = "B5A65BB6-E73E-4C3D-977C-33C86798AA5A",
|
|
||||||
fullscreen = true,
|
|
||||||
},
|
|
||||||
["zoom.us"] = {
|
|
||||||
desktop = 2,
|
|
||||||
screen = "D3142823-261D-46EF-B9C2-5181C7FE2CA5",
|
|
||||||
fullscreen = true,
|
|
||||||
},
|
|
||||||
["Microsoft Outlook"] = {
|
|
||||||
desktop = 3,
|
|
||||||
screen = "D3142823-261D-46EF-B9C2-5181C7FE2CA5",
|
|
||||||
fullscreen = true,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
local fullscreen = function(win)
|
local fullscreen = function(win)
|
||||||
local screen = win:screen()
|
local screen = win:screen()
|
||||||
|
|
||||||
local cell = grid.get(win, screen)
|
local cell = hs.grid.get(win, screen)
|
||||||
|
|
||||||
cell.x = 0
|
cell.x = 0
|
||||||
cell.y = 0
|
cell.y = 0
|
||||||
cell.w = 24
|
cell.w = 24
|
||||||
cell.h = 24
|
cell.h = 24
|
||||||
|
|
||||||
grid.set(win, cell, screen)
|
hs.grid.set(win, cell, screen)
|
||||||
end
|
end
|
||||||
|
|
||||||
function spoon:restoreAppsToScreens()
|
function spoon:restoreAppsToScreens()
|
||||||
local screens = {}
|
local screens = {}
|
||||||
for _, scr in ipairs(screen.allScreens()) do
|
for _, screen in ipairs(hs.screen.allScreens()) do
|
||||||
screens[scr:getUUID()] = scr
|
screens[screen:getUUID()] = screen
|
||||||
end
|
end
|
||||||
|
|
||||||
local currentSpaces = spaces.allSpaces()
|
|
||||||
|
|
||||||
local foundWindows = {}
|
|
||||||
|
|
||||||
for appName, def in pairs(appScreenMap) do
|
for appName, def in pairs(appScreenMap) do
|
||||||
local scr = screens[def.screen]
|
local scr = screens[def.screen]
|
||||||
if scr ~= nil then
|
if scr ~= nil then
|
||||||
local app = application.get(appName)
|
local app = hs.application.get(appName)
|
||||||
if app then
|
if app then
|
||||||
local appFilter = wf.new(appName)
|
local wf = hs.window.filter.new(appName)
|
||||||
if appFilter then
|
if wf then
|
||||||
-- TODO: Really bad performance
|
-- TODO: Really bad performance
|
||||||
foundWindows[appName] = appFilter:getWindows()
|
for _, win in pairs(wf:getWindows()) do
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for appName, windows in pairs(foundWindows) do
|
|
||||||
local def = appScreenMap[appName]
|
|
||||||
local scr = screens[def.screen]
|
|
||||||
|
|
||||||
for _, win in pairs(windows) do
|
|
||||||
if currentSpaces[def.screen] ~= nil then
|
|
||||||
print(appName .. " moving window into an index " .. def.desktop .. " which is space " .. currentSpaces[def.screen][def.desktop])
|
|
||||||
spaces.moveWindowToSpace(win, currentSpaces[def.screen][def.desktop])
|
|
||||||
end
|
|
||||||
|
|
||||||
print(appName .. " scheduling timer to move window into a screen")
|
|
||||||
timer.doAfter(1, function()
|
|
||||||
print(appName .. " moving window into a screen " .. def.screen)
|
|
||||||
|
|
||||||
win:moveToScreen(scr)
|
win:moveToScreen(scr)
|
||||||
if def.fullscreen then
|
if def.fullscreen then
|
||||||
timer.doAfter(1, function()
|
|
||||||
print(appName .. " fullscreening window")
|
|
||||||
|
|
||||||
fullscreen(win)
|
fullscreen(win)
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
end)
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,32 +1,27 @@
|
|||||||
windowMove = function()
|
windowMove = function()
|
||||||
local grid = hs.grid
|
|
||||||
local screen = hs.screen
|
|
||||||
local timer = hs.timer
|
|
||||||
local window = hs.window
|
|
||||||
|
|
||||||
-- move window to next screen
|
-- move window to next screen
|
||||||
hs.hotkey.bind({ "ctrl", "alt", "cmd" }, "N", function()
|
hs.hotkey.bind({ "ctrl", "alt", "cmd" }, "N", function()
|
||||||
local win = window.focusedWindow()
|
local win = hs.window.focusedWindow()
|
||||||
win:moveToScreen(win:screen():next())
|
win:moveToScreen(win:screen():next())
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local fullscreen = function(win)
|
local fullscreen = function(win)
|
||||||
local scr = win:screen()
|
local screen = win:screen()
|
||||||
|
|
||||||
local cell = grid.get(win, scr)
|
local cell = hs.grid.get(win, screen)
|
||||||
|
|
||||||
cell.x = 0
|
cell.x = 0
|
||||||
cell.y = 0
|
cell.y = 0
|
||||||
cell.w = 24
|
cell.w = 24
|
||||||
cell.h = 24
|
cell.h = 24
|
||||||
|
|
||||||
grid.set(win, cell, scr)
|
hs.grid.set(win, cell, screen)
|
||||||
end
|
end
|
||||||
|
|
||||||
local getScreenById = function(id)
|
local getScreenById = function(id)
|
||||||
for _, scr in ipairs(screen.allScreens()) do
|
for _, screen in ipairs(hs.screen.allScreens()) do
|
||||||
if scr:getUUID() == id then
|
if screen:getUUID() == id then
|
||||||
return scr
|
return screen
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -35,45 +30,39 @@ windowMove = function()
|
|||||||
|
|
||||||
hs.hotkey.bind({ "ctrl", "alt", "cmd" }, "pad1", function()
|
hs.hotkey.bind({ "ctrl", "alt", "cmd" }, "pad1", function()
|
||||||
-- DELL S2722DGM
|
-- DELL S2722DGM
|
||||||
local scr = getScreenById("0F6BDB5B-840D-40BE-AAC9-B467A78E057A")
|
local screen = getScreenById("0F6BDB5B-840D-40BE-AAC9-B467A78E057A")
|
||||||
if scr == nil then
|
if screen == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local win = window.focusedWindow()
|
local win = hs.window.focusedWindow()
|
||||||
win:moveToScreen(scr)
|
win:moveToScreen(screen)
|
||||||
timer.doAfter(1, function()
|
|
||||||
fullscreen(win)
|
fullscreen(win)
|
||||||
end)
|
end)
|
||||||
end)
|
|
||||||
|
|
||||||
hs.hotkey.bind({ "ctrl", "alt", "cmd" }, "pad2", function()
|
hs.hotkey.bind({ "ctrl", "alt", "cmd" }, "pad2", function()
|
||||||
-- DELL S2721DGF
|
-- DELL S2721DGF
|
||||||
local scr = getScreenById("D3142823-261D-46EF-B9C2-5181C7FE2CA5")
|
local screen = getScreenById("D3142823-261D-46EF-B9C2-5181C7FE2CA5")
|
||||||
if scr == nil then
|
if screen == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local win = window.focusedWindow()
|
local win = hs.window.focusedWindow()
|
||||||
win:moveToScreen(scr)
|
win:moveToScreen(screen)
|
||||||
timer.doAfter(1, function()
|
|
||||||
fullscreen(win)
|
fullscreen(win)
|
||||||
end)
|
end)
|
||||||
end)
|
|
||||||
|
|
||||||
hs.hotkey.bind({ "ctrl", "alt", "cmd" }, "pad3", function()
|
hs.hotkey.bind({ "ctrl", "alt", "cmd" }, "pad3", function()
|
||||||
-- AV Receiver
|
-- AV Receiver
|
||||||
local scr = getScreenById("B5A65BB6-E73E-4C3D-977C-33C86798AA5A")
|
local screen = getScreenById("B5A65BB6-E73E-4C3D-977C-33C86798AA5A")
|
||||||
if scr == nil then
|
if screen == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local win = window.focusedWindow()
|
local win = hs.window.focusedWindow()
|
||||||
win:moveToScreen(scr)
|
win:moveToScreen(screen)
|
||||||
timer.doAfter(1, function()
|
|
||||||
fullscreen(win)
|
fullscreen(win)
|
||||||
end)
|
end)
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
windowMove()
|
windowMove()
|
||||||
|
|||||||
@ -1,8 +1,4 @@
|
|||||||
windowTiling =function()
|
windowTiling =function()
|
||||||
local window = hs.window
|
|
||||||
local grid = hs.grid
|
|
||||||
local screen = hs.screen
|
|
||||||
|
|
||||||
hs.window.animationDuration = 0
|
hs.window.animationDuration = 0
|
||||||
hs.window.setShadows(false)
|
hs.window.setShadows(false)
|
||||||
local hyper = { "ctrl", "alt", "cmd" }
|
local hyper = { "ctrl", "alt", "cmd" }
|
||||||
@ -12,14 +8,14 @@ windowTiling =function()
|
|||||||
}
|
}
|
||||||
|
|
||||||
function wm:_nextStep(dim, offs, cb)
|
function wm:_nextStep(dim, offs, cb)
|
||||||
if window.focusedWindow() then
|
if hs.window.focusedWindow() then
|
||||||
local axis = dim == "w" and "x" or "y"
|
local axis = dim == "w" and "x" or "y"
|
||||||
local oppDim = dim == "w" and "h" or "w"
|
local oppDim = dim == "w" and "h" or "w"
|
||||||
local oppAxis = dim == "w" and "y" or "x"
|
local oppAxis = dim == "w" and "y" or "x"
|
||||||
local win = window.frontmostWindow()
|
local win = hs.window.frontmostWindow()
|
||||||
local scr = win:screen()
|
local screen = win:screen()
|
||||||
|
|
||||||
local cell = grid.get(win, scr)
|
local cell = hs.grid.get(win, screen)
|
||||||
|
|
||||||
local nextSize = self.sizes[1]
|
local nextSize = self.sizes[1]
|
||||||
for i = 1, #self.sizes do
|
for i = 1, #self.sizes do
|
||||||
@ -38,31 +34,32 @@ windowTiling =function()
|
|||||||
cell[oppAxis] = 0
|
cell[oppAxis] = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
grid.set(win, cell, scr)
|
hs.grid.set(win, cell, screen)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function wm:_fullscreen()
|
function wm:_fullscreen()
|
||||||
if hs.window.focusedWindow() then
|
if hs.window.focusedWindow() then
|
||||||
local win = window.frontmostWindow()
|
local win = hs.window.frontmostWindow()
|
||||||
local scr = win:screen()
|
local screen = win:screen()
|
||||||
|
|
||||||
local cell = grid.get(win, scr)
|
local cell = hs.grid.get(win, screen)
|
||||||
|
|
||||||
cell.x = 0
|
cell.x = 0
|
||||||
cell.y = 0
|
cell.y = 0
|
||||||
cell.w = self.GRID.w
|
cell.w = self.GRID.w
|
||||||
cell.h = self.GRID.h
|
cell.h = self.GRID.h
|
||||||
|
|
||||||
grid.set(win, cell, scr)
|
hs.grid.set(win, cell, screen)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function wm:_fullDimension(dim)
|
function wm:_fullDimension(dim)
|
||||||
if window.focusedWindow() then
|
if hs.window.focusedWindow() then
|
||||||
local win = window.frontmostWindow()
|
local win = hs.window.frontmostWindow()
|
||||||
local scr = win:screen()
|
local id = win:id()
|
||||||
local cell = grid.get(win, scr)
|
local screen = win:screen()
|
||||||
|
local cell = hs.grid.get(win, screen)
|
||||||
|
|
||||||
if dim == "x" then
|
if dim == "x" then
|
||||||
cell = "0,0 " .. self.GRID.w .. "x" .. self.GRID.h
|
cell = "0,0 " .. self.GRID.w .. "x" .. self.GRID.h
|
||||||
@ -71,7 +68,7 @@ windowTiling =function()
|
|||||||
cell[dim == "w" and "x" or "y"] = 0
|
cell[dim == "w" and "x" or "y"] = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
grid.set(win, cell, scr)
|
hs.grid.set(win, cell, screen)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -84,9 +81,9 @@ windowTiling =function()
|
|||||||
}
|
}
|
||||||
self.GRID = { w = 24, h = 24 }
|
self.GRID = { w = 24, h = 24 }
|
||||||
|
|
||||||
grid.setGrid(self.GRID.w .. "x" .. self.GRID.h)
|
hs.grid.setGrid(self.GRID.w .. "x" .. self.GRID.h)
|
||||||
grid.MARGINX = 0
|
hs.grid.MARGINX = 0
|
||||||
grid.MARGINY = 0
|
hs.grid.MARGINY = 0
|
||||||
|
|
||||||
hs.hotkey.bind(hyper, "down", function()
|
hs.hotkey.bind(hyper, "down", function()
|
||||||
self._pressed.down = true
|
self._pressed.down = true
|
||||||
|
|||||||
@ -17,13 +17,13 @@ keybind = super+alt+down=unbind
|
|||||||
keybind = super+alt+left=unbind
|
keybind = super+alt+left=unbind
|
||||||
keybind = super+alt+up=unbind
|
keybind = super+alt+up=unbind
|
||||||
|
|
||||||
keybind = super+alt+k=new_split:down
|
keybind = super+k=new_split:down
|
||||||
keybind = super+alt+l=new_split:right
|
keybind = super+l=new_split:right
|
||||||
|
|
||||||
keybind = super+j=goto_split:up
|
keybind = super+alt+j=goto_split:up
|
||||||
keybind = super+k=goto_split:down
|
keybind = super+alt+k=goto_split:down
|
||||||
keybind = super+h=goto_split:left
|
keybind = super+alt+h=goto_split:left
|
||||||
keybind = super+l=goto_split:right
|
keybind = super+alt+l=goto_split:right
|
||||||
|
|
||||||
keybind = super+shift+j=resize_split:up,10
|
keybind = super+shift+j=resize_split:up,10
|
||||||
keybind = super+shift+k=resize_split:down,10
|
keybind = super+shift+k=resize_split:down,10
|
||||||
|
|||||||
@ -285,11 +285,5 @@ in
|
|||||||
aws --profile $profile "$@";
|
aws --profile $profile "$@";
|
||||||
done
|
done
|
||||||
''}'';
|
''}'';
|
||||||
|
|
||||||
veracode-login = ''${pkgs.writeShellScript "veracode-login" ''
|
|
||||||
for region in us eu; do
|
|
||||||
aws sso login --profile $region-shared-services
|
|
||||||
done
|
|
||||||
''}'';
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user