Compare commits
No commits in common. "143830ce2742faa7bace4f5bf9d30eb4bb0cd590" and "b71d16c7cfffda37f4a0542439a7f1e3870a2e94" have entirely different histories.
143830ce27
...
b71d16c7cf
@ -1,9 +1,10 @@
|
|||||||
return (function()
|
return (function()
|
||||||
|
local application = hs.application
|
||||||
local grid = hs.grid
|
local grid = hs.grid
|
||||||
local screen = hs.screen
|
local screen = hs.screen
|
||||||
local spaces = hs.spaces
|
local spaces = hs.spaces
|
||||||
local timer = hs.timer
|
local timer = hs.timer
|
||||||
local window = hs.window
|
local wf = hs.window.filter
|
||||||
|
|
||||||
spoon = {
|
spoon = {
|
||||||
name = "C3C Workspace";
|
name = "C3C Workspace";
|
||||||
@ -32,7 +33,8 @@ return (function()
|
|||||||
fullscreen = true,
|
fullscreen = true,
|
||||||
},
|
},
|
||||||
["zoom.us"] = {
|
["zoom.us"] = {
|
||||||
screen = "B5A65BB6-E73E-4C3D-977C-33C86798AA5A",
|
desktop = 2,
|
||||||
|
screen = "D3142823-261D-46EF-B9C2-5181C7FE2CA5",
|
||||||
fullscreen = true,
|
fullscreen = true,
|
||||||
},
|
},
|
||||||
["Microsoft Outlook"] = {
|
["Microsoft Outlook"] = {
|
||||||
@ -63,24 +65,40 @@ return (function()
|
|||||||
|
|
||||||
local currentSpaces = spaces.allSpaces()
|
local currentSpaces = spaces.allSpaces()
|
||||||
|
|
||||||
for _, v in pairs(window.list()) do
|
local foundWindows = {}
|
||||||
local def = appScreenMap[v.kCGWindowOwnerName]
|
|
||||||
local win = window.get(v.kCGWindowNumber)
|
for appName, def in pairs(appScreenMap) do
|
||||||
if def ~= nil and win ~= nil then
|
local scr = screens[def.screen]
|
||||||
if def.desktop ~= nil and currentSpaces[def.screen] ~= nil then
|
if scr ~= nil then
|
||||||
print(v.kCGWindowOwnerName .. " moving window into an index " .. def.desktop .. " which is space " .. currentSpaces[def.screen][def.desktop])
|
local app = application.get(appName)
|
||||||
|
if app then
|
||||||
|
local appFilter = wf.new(appName)
|
||||||
|
if appFilter then
|
||||||
|
-- TODO: Really bad performance
|
||||||
|
foundWindows[appName] = appFilter:getWindows()
|
||||||
|
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])
|
spaces.moveWindowToSpace(win, currentSpaces[def.screen][def.desktop])
|
||||||
end
|
end
|
||||||
|
|
||||||
local scr = screens[def.screen]
|
print(appName .. " scheduling timer to move window into a screen")
|
||||||
if scr ~= nil then
|
|
||||||
timer.doAfter(1, function()
|
timer.doAfter(1, function()
|
||||||
print(v.kCGWindowOwnerName .. " moving window into a screen " .. def.screen)
|
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()
|
timer.doAfter(1, function()
|
||||||
print(v.kCGWindowOwnerName .. " fullscreening window")
|
print(appName .. " fullscreening window")
|
||||||
|
|
||||||
fullscreen(win)
|
fullscreen(win)
|
||||||
end)
|
end)
|
||||||
@ -89,7 +107,6 @@ return (function()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
-- https://github.com/Hammerspoon/hammerspoon/blob/master/SPOONS.md#hotkeys
|
-- https://github.com/Hammerspoon/hammerspoon/blob/master/SPOONS.md#hotkeys
|
||||||
function spoon:bindHotKeys(mapping)
|
function spoon:bindHotKeys(mapping)
|
||||||
|
|||||||
@ -222,188 +222,6 @@ let
|
|||||||
role = "EngineerAdmin";
|
role = "EngineerAdmin";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
old-world = {
|
|
||||||
"932961976631" = {
|
|
||||||
name = "Veracode Laputa";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"747166839737" = {
|
|
||||||
name = "Alternator Prod";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"849762296401" = {
|
|
||||||
name = "aws-cloudloop";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"555828001259" = {
|
|
||||||
name = "aws-devops";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"095180515219" = {
|
|
||||||
name = "aws-disco-dev";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"602400992919" = {
|
|
||||||
name = "aws-disco-prod";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"671440995558" = {
|
|
||||||
name = "aws-mpt";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"390809507444" = {
|
|
||||||
name = "aws-research";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"547681985753" = {
|
|
||||||
name = "aws-static-dev";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"576836758243" = {
|
|
||||||
name = "aws-static-prod";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"272739225222" = {
|
|
||||||
name = "Greenlight Dev";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"187309115203" = {
|
|
||||||
name = "Greenlight Prod";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"312566581319" = {
|
|
||||||
name = "mvsa-prod";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"528304698271" = {
|
|
||||||
name = "ops1";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"178484873978" = {
|
|
||||||
name = "ops2";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"036935693235" = {
|
|
||||||
name = "platform-integrations-dev";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"101042440253" = {
|
|
||||||
name = "platform-integrations-prod";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"769404944768" = {
|
|
||||||
name = "Veracode GovCloud Parent Staging";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"227458413628" = {
|
|
||||||
name = "veracode-asc-ilt";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"637659597440" = {
|
|
||||||
name = "veracode-dataservices-dev";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"360252896736" = {
|
|
||||||
name = "veracode-dataservices-production";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"634743813634" = {
|
|
||||||
name = "veracode-elearning-nonprod";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"231131777030" = {
|
|
||||||
name = "veracode-gov-parent-nonproduction";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"391700338873" = {
|
|
||||||
name = "veracode-gov-parent-production";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"083679226615" = {
|
|
||||||
name = "veracode-hackathon";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"228885042232" = {
|
|
||||||
name = "veracode-info-sec";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"653330403905" = {
|
|
||||||
name = "veracode-mpt-mffc";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"566201213358" = {
|
|
||||||
name = "veracode-nonproduction";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"518031149952" = {
|
|
||||||
name = "veracode-production";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"966752150300" = {
|
|
||||||
name = "veracode-qaoncloud-nonproduction";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"221433242586" = {
|
|
||||||
name = "veracode-solutions-architect";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
"576647558819" = {
|
|
||||||
name = "VeraRadio";
|
|
||||||
role = "EngineerAdmin";
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
longbow = {
|
|
||||||
"520315734741" = {
|
|
||||||
name = "Audit";
|
|
||||||
role = "AWS-Engineer-Admin";
|
|
||||||
};
|
|
||||||
"853528449373" = {
|
|
||||||
name = "demo";
|
|
||||||
role = "AWS-Engineer-Admin";
|
|
||||||
};
|
|
||||||
"058887878640" = {
|
|
||||||
name = "Dev";
|
|
||||||
role = "AWS-Engineer-Admin";
|
|
||||||
};
|
|
||||||
"539590419140" = {
|
|
||||||
name = "Hans Gruber";
|
|
||||||
role = "AWS-Engineer-Admin";
|
|
||||||
};
|
|
||||||
"048352314288" = {
|
|
||||||
name = "Log archive";
|
|
||||||
role = "AWS-Engineer-Admin";
|
|
||||||
};
|
|
||||||
"066179854877" = {
|
|
||||||
name = "Production";
|
|
||||||
role = "AWS-Engineer-Admin";
|
|
||||||
};
|
|
||||||
"388353868666" = {
|
|
||||||
name = "SaaS Seller Account";
|
|
||||||
role = "AWS-Engineer-Admin";
|
|
||||||
};
|
|
||||||
"057168112839" = {
|
|
||||||
name = "Sandbox";
|
|
||||||
role = "AWS-Engineer-Admin";
|
|
||||||
};
|
|
||||||
"704459292453" = {
|
|
||||||
name = "Shared Services";
|
|
||||||
role = "AWS-Engineer-Admin";
|
|
||||||
};
|
|
||||||
"108911762463" = {
|
|
||||||
name = "Staging";
|
|
||||||
role = "AWS-Engineer-Admin";
|
|
||||||
};
|
|
||||||
"252894127310" = {
|
|
||||||
name = "TalonX";
|
|
||||||
role = "AWS-Engineer-Admin";
|
|
||||||
};
|
|
||||||
"932480454180" = {
|
|
||||||
name = "Test Customer";
|
|
||||||
role = "AWS-Engineer-Admin";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@ -422,26 +240,16 @@ in
|
|||||||
sso_region = eu-central-1
|
sso_region = eu-central-1
|
||||||
sso_registration_scopes = sso:account:access
|
sso_registration_scopes = sso:account:access
|
||||||
|
|
||||||
[sso-session veracode-old-world]
|
|
||||||
sso_start_url = https://d-90679ac9ea.awsapps.com/start
|
|
||||||
sso_region = us-east-1
|
|
||||||
sso_registration_scopes = sso:account:access
|
|
||||||
|
|
||||||
[sso-session veracode-longbow]
|
|
||||||
sso_start_url = https://d-90677f445e.awsapps.com/start
|
|
||||||
sso_region = eu-central-1
|
|
||||||
sso_registration_scopes = sso:account:access
|
|
||||||
|
|
||||||
${builtins.concatStringsSep "\n" (
|
${builtins.concatStringsSep "\n" (
|
||||||
lib.mapAttrsToList (id: account: ''
|
lib.mapAttrsToList (id: account: ''
|
||||||
[profile ${builtins.replaceStrings [ " " ] [ "" ] account.name}]
|
[profile ${account.name}]
|
||||||
sso_account_id = ${id}
|
sso_account_id = ${id}
|
||||||
sso_role_name = ${account.role}
|
sso_role_name = ${account.role}
|
||||||
sso_session = veracode-us
|
sso_session = veracode-us
|
||||||
region = us-east-1
|
region = us-east-1
|
||||||
output = json
|
output = json
|
||||||
|
|
||||||
[profile us-${builtins.replaceStrings [ " " ] [ "" ] account.name}]
|
[profile us-${account.name}]
|
||||||
sso_account_id = ${id}
|
sso_account_id = ${id}
|
||||||
sso_role_name = ${account.role}
|
sso_role_name = ${account.role}
|
||||||
sso_session = veracode-us
|
sso_session = veracode-us
|
||||||
@ -452,21 +260,16 @@ in
|
|||||||
|
|
||||||
${builtins.concatStringsSep "\n" (
|
${builtins.concatStringsSep "\n" (
|
||||||
lib.mapAttrsToList (id: account: ''
|
lib.mapAttrsToList (id: account: ''
|
||||||
${
|
${if lib.any (usAccount: usAccount.name == account.name) (lib.attrValues accounts.us) then "" else ''
|
||||||
if lib.any (usAccount: usAccount.name == account.name) (lib.attrValues accounts.us) then
|
[profile ${account.name}]
|
||||||
""
|
|
||||||
else
|
|
||||||
''
|
|
||||||
[profile ${builtins.replaceStrings [ " " ] [ "" ] account.name}]
|
|
||||||
sso_account_id = ${id}
|
sso_account_id = ${id}
|
||||||
sso_role_name = ${account.role}
|
sso_role_name = ${account.role}
|
||||||
sso_session = veracode-eu
|
sso_session = veracode-eu
|
||||||
region = eu-central-1
|
region = eu-central-1
|
||||||
output = json
|
output = json
|
||||||
''
|
''}
|
||||||
}
|
|
||||||
|
|
||||||
[profile eu-${builtins.replaceStrings [ " " ] [ "" ] account.name}]
|
[profile eu-${account.name}]
|
||||||
sso_account_id = ${id}
|
sso_account_id = ${id}
|
||||||
sso_role_name = ${account.role}
|
sso_role_name = ${account.role}
|
||||||
sso_session = veracode-eu
|
sso_session = veracode-eu
|
||||||
@ -474,64 +277,6 @@ in
|
|||||||
output = json
|
output = json
|
||||||
'') accounts.eu
|
'') accounts.eu
|
||||||
)}
|
)}
|
||||||
|
|
||||||
${builtins.concatStringsSep "\n" (
|
|
||||||
lib.mapAttrsToList (id: account: ''
|
|
||||||
${
|
|
||||||
if
|
|
||||||
lib.any (otherAccount: otherAccount.name == account.name) (
|
|
||||||
lib.attrValues (accounts.us // accounts.eu)
|
|
||||||
)
|
|
||||||
then
|
|
||||||
""
|
|
||||||
else
|
|
||||||
''
|
|
||||||
[profile ${builtins.replaceStrings [ " " ] [ "" ] account.name}]
|
|
||||||
sso_account_id = ${id}
|
|
||||||
sso_role_name = ${account.role}
|
|
||||||
sso_session = veracode-old-world
|
|
||||||
region = eu-central-1
|
|
||||||
output = json
|
|
||||||
''
|
|
||||||
}
|
|
||||||
|
|
||||||
[profile old-world-${builtins.replaceStrings [ " " ] [ "" ] account.name}]
|
|
||||||
sso_account_id = ${id}
|
|
||||||
sso_role_name = ${account.role}
|
|
||||||
sso_session = veracode-old-world
|
|
||||||
region = eu-central-1
|
|
||||||
output = json
|
|
||||||
'') accounts.old-world
|
|
||||||
)}
|
|
||||||
|
|
||||||
${builtins.concatStringsSep "\n" (
|
|
||||||
lib.mapAttrsToList (id: account: ''
|
|
||||||
${
|
|
||||||
if
|
|
||||||
lib.any (otherAccount: otherAccount.name == account.name) (
|
|
||||||
lib.attrValues (accounts.us // accounts.eu // accounts.old-world)
|
|
||||||
)
|
|
||||||
then
|
|
||||||
""
|
|
||||||
else
|
|
||||||
''
|
|
||||||
[profile ${builtins.replaceStrings [ " " ] [ "" ] account.name}]
|
|
||||||
sso_account_id = ${id}
|
|
||||||
sso_role_name = ${account.role}
|
|
||||||
sso_session = veracode-longbow
|
|
||||||
region = eu-central-1
|
|
||||||
output = json
|
|
||||||
''
|
|
||||||
}
|
|
||||||
|
|
||||||
[profile longbow-${builtins.replaceStrings [ " " ] [ "" ] account.name}]
|
|
||||||
sso_account_id = ${id}
|
|
||||||
sso_role_name = ${account.role}
|
|
||||||
sso_session = veracode-longbow
|
|
||||||
region = eu-central-1
|
|
||||||
output = json
|
|
||||||
'') accounts.longbow
|
|
||||||
)}
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -559,9 +304,8 @@ in
|
|||||||
|
|
||||||
veracode-login = ''${pkgs.writeShellScript "veracode-login" ''
|
veracode-login = ''${pkgs.writeShellScript "veracode-login" ''
|
||||||
for region in us eu; do
|
for region in us eu; do
|
||||||
aws sso login --profile $region-shared-services &
|
aws sso login --profile $region-shared-services
|
||||||
done
|
done
|
||||||
aws sso login --profile old-world-aws-devops &
|
|
||||||
''}'';
|
''}'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user