Compare commits
2 Commits
52e482df12
...
ddee794c11
| Author | SHA1 | Date | |
|---|---|---|---|
| ddee794c11 | |||
| 0b03d3625b |
@@ -26,6 +26,17 @@ local function notif(text, timeout, icon)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- function to merge lists
|
||||||
|
local function merge_into(first, second)
|
||||||
|
local combined = {}
|
||||||
|
|
||||||
|
-- Look at me using lua im so good at this
|
||||||
|
table.move(first, 1, #first, 1, combined)
|
||||||
|
table.move(second, 1, #second, #first + 1, combined)
|
||||||
|
|
||||||
|
return combined
|
||||||
|
end
|
||||||
|
|
||||||
local corneKeyboardString = "qwertyuiop"
|
local corneKeyboardString = "qwertyuiop"
|
||||||
|
|
||||||
-- Set modifier keys
|
-- Set modifier keys
|
||||||
@@ -101,15 +112,13 @@ local globalAppBinds = {
|
|||||||
key = { "h" },
|
key = { "h" },
|
||||||
dispatch = function()
|
dispatch = function()
|
||||||
local pos = normalise_current_window_pos()
|
local pos = normalise_current_window_pos()
|
||||||
if pos then
|
-- 9 derived from 5 gap plus 3 border (8), so first pixel of window is 9
|
||||||
-- 9 derived from 5 gap plus 3 border (8), so first pixel of window is 9
|
if pos and pos == 9 then
|
||||||
if pos == 9 then
|
-- If first window, then move to monitor to the left
|
||||||
-- If first window, then move to monitor to the left
|
hl.dispatch(hl.dsp.focus({ monitor = "left" }))
|
||||||
hl.dispatch(hl.dsp.focus({ monitor = "left" }))
|
else
|
||||||
else
|
-- If not the first window then go to the column to the left
|
||||||
-- If not the first window then go to the column to the left
|
hl.dispatch(hl.dsp.layout("move -col"))
|
||||||
hl.dispatch(hl.dsp.layout("move -col"))
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
@@ -164,32 +173,28 @@ local globalAppBinds = {
|
|||||||
{ mod = subMod, key = { "SHIFT + mouse:272" }, dispatch = hl.dsp.window.resize(), opts = { mouse = true } },
|
{ mod = subMod, key = { "SHIFT + mouse:272" }, dispatch = hl.dsp.window.resize(), opts = { mouse = true } },
|
||||||
}
|
}
|
||||||
|
|
||||||
-- function to merge lists
|
|
||||||
local function merge_into(first, second)
|
|
||||||
for index, item in pairs(second) do
|
|
||||||
first[index] = item
|
|
||||||
end
|
|
||||||
return first
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Workspace switch keys
|
-- Workspace switch keys
|
||||||
for _, bind in ipairs(globalAppBinds) do
|
for _, bind in ipairs(globalAppBinds) do
|
||||||
-- Mod specified or default modifier
|
-- Mod specified or default modifier
|
||||||
local modBind = bind.mod or mainMod
|
local modBind = bind.mod or mainMod
|
||||||
local command
|
local command
|
||||||
|
|
||||||
-- If the dispatcher isnt a string evaluate
|
-- If the dispatcher isnt a string evaluate
|
||||||
-- it as a command
|
-- it as a command
|
||||||
if type(bind.dispatch) ~= "string" then
|
if type(bind.dispatch) ~= "string" then
|
||||||
command = bind.dispatch
|
command = bind.dispatch
|
||||||
else
|
else
|
||||||
|
-- If it is a string then wrap it in exec_cmd
|
||||||
command = hl.dsp.exec_cmd(bind.dispatch)
|
command = hl.dsp.exec_cmd(bind.dispatch)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- If there are options then apply them
|
-- If there are options then apply them
|
||||||
local opts = {}
|
local opts = {}
|
||||||
if bind.opts then
|
if bind.opts then
|
||||||
opts = bind.opts
|
opts = bind.opts
|
||||||
end
|
end
|
||||||
-- If there is a specific key for that device then
|
|
||||||
|
-- If there is a specific key for that keybindIndex then
|
||||||
-- bind it, else bind the default key
|
-- bind it, else bind the default key
|
||||||
if bind.key[keybindIndex] then
|
if bind.key[keybindIndex] then
|
||||||
hl.bind(modBind .. bind.key[keybindIndex], command, opts)
|
hl.bind(modBind .. bind.key[keybindIndex], command, opts)
|
||||||
@@ -213,7 +218,10 @@ for char in keyboardString:gmatch(".") do
|
|||||||
end
|
end
|
||||||
|
|
||||||
for index, bind in ipairs(keyboardSplit) do
|
for index, bind in ipairs(keyboardSplit) do
|
||||||
|
-- Focus workspace index
|
||||||
hl.bind(mainMod .. bind, hl.dsp.focus({ workspace = index }))
|
hl.bind(mainMod .. bind, hl.dsp.focus({ workspace = index }))
|
||||||
|
|
||||||
|
-- Move to workspace no follow
|
||||||
hl.bind(mainMod .. "SHIFT + " .. bind, hl.dsp.window.move({ workspace = index, follow = false }))
|
hl.bind(mainMod .. "SHIFT + " .. bind, hl.dsp.window.move({ workspace = index, follow = false }))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -7,16 +7,25 @@ local appList = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
local localAppList
|
local localAppList
|
||||||
|
local desktopAppList = {
|
||||||
|
"wayvnc 0.0.0.0 --output=DP-1",
|
||||||
|
}
|
||||||
|
local laptopApplist = {
|
||||||
|
"way-edges",
|
||||||
|
}
|
||||||
|
|
||||||
if Hostname == "HACKSTATION" then
|
if Hostname == "HACKSTATION" then
|
||||||
-- If on desktop do desktop things
|
-- If on desktop do desktop things
|
||||||
localAppList = {
|
localAppList = desktopAppList
|
||||||
"wayvnc 0.0.0.0 --output=DP-1",
|
|
||||||
}
|
|
||||||
elseif Hostname == "mobile02" then
|
elseif Hostname == "mobile02" then
|
||||||
-- If on laptop, do laptop things
|
-- If on laptop, do laptop things
|
||||||
localAppList = {
|
localAppList = laptopApplist
|
||||||
"way-edges",
|
elseif Hostname == "mobile03" then
|
||||||
}
|
-- If on other laptop, do other laptop things
|
||||||
|
localAppList = laptopApplist
|
||||||
|
else
|
||||||
|
-- Prevents null errors
|
||||||
|
localAppList = { "echo placeholder" }
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, command in ipairs(localAppList) do
|
for _, command in ipairs(localAppList) do
|
||||||
|
|||||||
Reference in New Issue
Block a user