Finalise workspaces config
This commit is contained in:
@@ -228,6 +228,7 @@ hl.window_rule({
|
|||||||
hl.window_rule({
|
hl.window_rule({
|
||||||
name = "steam-float",
|
name = "steam-float",
|
||||||
float = true,
|
float = true,
|
||||||
|
no_initial_focus = true,
|
||||||
workspace = "name:Gaming_1",
|
workspace = "name:Gaming_1",
|
||||||
idle_inhibit = "fullscreen",
|
idle_inhibit = "fullscreen",
|
||||||
match = {
|
match = {
|
||||||
|
|||||||
+22
-27
@@ -6,15 +6,7 @@ local workspace_map = {
|
|||||||
"Writing",
|
"Writing",
|
||||||
}
|
}
|
||||||
|
|
||||||
local monitor_binds = {}
|
|
||||||
|
|
||||||
local function setup_monitors()
|
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
|
local monitor_count = #monitors
|
||||||
|
|
||||||
@@ -32,28 +24,31 @@ local function setup_monitors()
|
|||||||
default = i == 1,
|
default = i == 1,
|
||||||
})
|
})
|
||||||
|
|
||||||
table.insert(
|
hl.bind(
|
||||||
monitor_binds,
|
"SUPER + code:1" .. (i - 1),
|
||||||
hl.bind(
|
hl.dsp.focus({ workspace = "name:" .. workspace_name }),
|
||||||
"SUPER + code:1" .. (i - 1),
|
{ description = "Switch to workspace " .. workspace_map[i] }
|
||||||
hl.dsp.focus({ workspace = "name:" .. workspace_name }),
|
|
||||||
{ description = "Switch to workspace " .. workspace_map[i] }
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
table.insert(
|
hl.bind("SUPER + SHIFT + code:1" .. (i - 1), function()
|
||||||
monitor_binds,
|
local active_workspace = hl.get_active_workspace()
|
||||||
hl.bind("SUPER + SHIFT + code:1" .. (i - 1), function()
|
local active_workspace_name = active_workspace.name
|
||||||
local active_workspace = hl.get_active_workspace()
|
local monitor_suffix = active_workspace_name:match("_(%d+)$") or "1"
|
||||||
local active_workspace_name = active_workspace.name
|
local new_workspace = "name:" .. workspace_map[i] .. "_" .. monitor_suffix
|
||||||
local monitor_suffix = active_workspace_name:match("_(%d+)$") or "1"
|
-- local new_workspace = (i - 1) * monitor_count + active_workspace.id
|
||||||
local new_workspace = "name:" .. workspace_map[i] .. "_" .. monitor_suffix
|
hl.notification.create({ text = new_workspace, duration = 2000 })
|
||||||
-- local new_workspace = (i - 1) * monitor_count + active_workspace.id
|
hl.dispatch(hl.dsp.window.move({ workspace = new_workspace, follow = false }))
|
||||||
hl.notification.create({ text = new_workspace, duration = 2000 })
|
end, { description = "Move window to workspace " .. workspace_map[i] })
|
||||||
hl.dispatch(hl.dsp.window.move({ workspace = new_workspace, follow = false }))
|
end
|
||||||
end, { description = "Move window to workspace " .. workspace_map[i] })
|
|
||||||
)
|
-- A hack to move to the Home workspace when Hyprland first loads
|
||||||
|
if hl.get_active_workspace().id == 1 then
|
||||||
|
for j = monitor_count, 1, -1 do
|
||||||
|
local monitor = monitors[j]
|
||||||
|
hl.dispatch(hl.dsp.focus({ monitor = monitor.name }))
|
||||||
|
hl.dispatch(hl.dsp.focus({ workspace = "name:Home_" .. j, on_current_monitor = true }))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user