Figuring out workspaces
This commit is contained in:
+6
-14
@@ -176,7 +176,7 @@ hl.window_rule({
|
|||||||
hl.window_rule({
|
hl.window_rule({
|
||||||
name = "retroarch-fullscreen",
|
name = "retroarch-fullscreen",
|
||||||
fullscreen = true,
|
fullscreen = true,
|
||||||
workspace = 5,
|
workspace = "name:Gaming_1",
|
||||||
tag = "-default-opacity",
|
tag = "-default-opacity",
|
||||||
opacity = "1 1",
|
opacity = "1 1",
|
||||||
idle_inhibit = "fullscreen",
|
idle_inhibit = "fullscreen",
|
||||||
@@ -217,26 +217,18 @@ hl.window_rule({
|
|||||||
-- Position drawing
|
-- Position drawing
|
||||||
hl.window_rule({
|
hl.window_rule({
|
||||||
name = "krita-drawing",
|
name = "krita-drawing",
|
||||||
workspace = 5,
|
workspace = "name:Art_1",
|
||||||
tag = "-default-opacity",
|
tag = "-default-opacity",
|
||||||
opacity = "1 1",
|
opacity = "1 1",
|
||||||
match = {
|
match = {
|
||||||
class = "(krita)",
|
class = "(krita)",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
-- Position TV
|
|
||||||
hl.window_rule({
|
|
||||||
name = "tv-apps",
|
|
||||||
workspace = 7,
|
|
||||||
match = {
|
|
||||||
class = "(chrome-youtube.com__-Default|chrome-netflix.com__-Default)",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
-- Float Steam
|
-- Float Steam
|
||||||
hl.window_rule({
|
hl.window_rule({
|
||||||
name = "steam-float",
|
name = "steam-float",
|
||||||
float = true,
|
float = true,
|
||||||
workspace = 7,
|
workspace = "name:Gaming_1",
|
||||||
idle_inhibit = "fullscreen",
|
idle_inhibit = "fullscreen",
|
||||||
match = {
|
match = {
|
||||||
class = "steam",
|
class = "steam",
|
||||||
@@ -268,16 +260,16 @@ hl.window_rule({
|
|||||||
})
|
})
|
||||||
-- Float Lunar Client
|
-- Float Lunar Client
|
||||||
hl.window_rule({
|
hl.window_rule({
|
||||||
name = "lunar-client-float",
|
name = "atlauncher-float",
|
||||||
float = true,
|
float = true,
|
||||||
workspace = 7,
|
workspace = "name:Gaming_1",
|
||||||
center = true,
|
center = true,
|
||||||
size = { 1100, 700 },
|
size = { 1100, 700 },
|
||||||
tag = "-default-opacity",
|
tag = "-default-opacity",
|
||||||
opacity = "1 1",
|
opacity = "1 1",
|
||||||
idle_inhibit = "fullscreen",
|
idle_inhibit = "fullscreen",
|
||||||
match = {
|
match = {
|
||||||
class = "lunarclient",
|
class = "atlauncher",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
-- Floating windows
|
-- Floating windows
|
||||||
|
|||||||
+35
-19
@@ -6,36 +6,52 @@ local workspace_map = {
|
|||||||
"Writing",
|
"Writing",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local monitor_binds = {}
|
||||||
|
|
||||||
|
local function setup_monitors()
|
||||||
|
-- Clear old binds
|
||||||
|
for _, bind in ipairs(monitor_binds) do
|
||||||
|
hl.unbind(bind)
|
||||||
|
end
|
||||||
|
monitor_binds = {}
|
||||||
|
|
||||||
local monitors = hl.get_monitors()
|
local monitors = hl.get_monitors()
|
||||||
|
local monitor_count = #monitors
|
||||||
|
|
||||||
-- Move active window to a workspace with SUPER + SHIFT + [1-5]
|
-- Move active window to a workspace with SUPER + SHIFT + [1-5]
|
||||||
for i = 1, 5 do
|
for i = 1, 5 do
|
||||||
|
for j = monitor_count, 1, -1 do
|
||||||
|
local monitor = monitors[j]
|
||||||
|
local workspace_id = "name:" .. workspace_map[i] .. "_" .. j
|
||||||
|
hl.notification.create({ text = workspace_id, duration = 2000 })
|
||||||
hl.workspace_rule({
|
hl.workspace_rule({
|
||||||
workspace = tostring((i * 2) - 1),
|
workspace = tostring(workspace_id),
|
||||||
monitor = monitors[1].name,
|
monitor = monitor.name,
|
||||||
})
|
})
|
||||||
|
|
||||||
if monitors[2] then
|
table.insert(
|
||||||
hl.workspace_rule({
|
monitor_binds,
|
||||||
workspace = tostring(i * 2),
|
hl.bind("SUPER + code:1" .. (i - 1), function()
|
||||||
monitor = monitors[2].name,
|
hl.dsp.focus({ workspace = workspace_id })
|
||||||
})
|
hl.notification.create({ text = workspace_id, duration = 2000 })
|
||||||
|
end, { description = "Switch to workspace " .. workspace_map[i] })
|
||||||
hl.bind(
|
|
||||||
"SUPER + code:1" .. (i - 1),
|
|
||||||
hl.dsp.focus({ workspace = tostring(i * 2) }),
|
|
||||||
{ description = "Switch to workspace " .. workspace_map[i] }
|
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
hl.bind(
|
|
||||||
"SUPER + code:1" .. (i - 1),
|
|
||||||
hl.dsp.focus({ workspace = tostring((i * 2) - 1) }),
|
|
||||||
{ description = "Switch to workspace" .. i }
|
|
||||||
)
|
|
||||||
|
|
||||||
|
table.insert(
|
||||||
|
monitor_binds,
|
||||||
hl.bind("SUPER + SHIFT + code:1" .. (i - 1), function()
|
hl.bind("SUPER + SHIFT + code:1" .. (i - 1), function()
|
||||||
local active_workspace = hl.get_active_workspace()
|
local active_workspace = hl.get_active_workspace()
|
||||||
local new_workspace = (i * 2) - (active_workspace.id % 2)
|
local active_workspace_name = active_workspace.name
|
||||||
hl.dispatch(hl.dsp.window.move({ workspace = tostring(new_workspace), follow = false }))
|
local monitor_suffix = active_workspace_name:match("_(%d+)$") or "1"
|
||||||
|
local new_workspace = "name:" .. workspace_map[i] .. "_" .. monitor_suffix
|
||||||
|
hl.notification.create({ text = new_workspace, duration = 2000 })
|
||||||
|
hl.dispatch(hl.dsp.window.move({ workspace = new_workspace, follow = false }))
|
||||||
end, { description = "Move window to workspace " .. workspace_map[i] })
|
end, { description = "Move window to workspace " .. workspace_map[i] })
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
hl.on("monitor.added", setup_monitors)
|
||||||
|
hl.on("monitor.removed", setup_monitors)
|
||||||
|
hl.on("config.reloaded", setup_monitors)
|
||||||
|
|||||||
@@ -29,11 +29,21 @@
|
|||||||
"8": "",
|
"8": "",
|
||||||
"9": "",
|
"9": "",
|
||||||
"10": "",
|
"10": "",
|
||||||
|
"name:Home_1": "",
|
||||||
|
"name:Dev_1": "",
|
||||||
|
"name:Art_1": "",
|
||||||
|
"name:Gaming_1": "",
|
||||||
|
"name:Writing_1": "",
|
||||||
|
"name:Home_2": "",
|
||||||
|
"name:Dev_2": "",
|
||||||
|
"name:Art_2": "",
|
||||||
|
"name:Gaming_2": "",
|
||||||
|
"name:Writing_2": "",
|
||||||
},
|
},
|
||||||
"persistent-workspaces": {
|
"persistent-workspaces": {
|
||||||
"eDP-1": [1, 3, 5, 7, 9],
|
"eDP-1": ["name:Home_1", "name:Dev_1", "name:Art_1", "name:Gaming_1", "name:Writing_1"],
|
||||||
"DP-1": [1, 3, 5, 7, 9],
|
"DP-1": ["name:Home_1", "name:Dev_1", "name:Art_1", "name:Gaming_1", "name:Writing_1"],
|
||||||
"DP-2": [2, 4, 6, 8, 10]
|
"DP-2": ["name:Home_2", "name:Dev_2", "name:Art_2", "name:Gaming_2", "name:Writing_2"],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"custom/station": {
|
"custom/station": {
|
||||||
|
|||||||
Reference in New Issue
Block a user