Finalise workspaces config
This commit is contained in:
@@ -228,6 +228,7 @@ hl.window_rule({
|
||||
hl.window_rule({
|
||||
name = "steam-float",
|
||||
float = true,
|
||||
no_initial_focus = true,
|
||||
workspace = "name:Gaming_1",
|
||||
idle_inhibit = "fullscreen",
|
||||
match = {
|
||||
|
||||
@@ -6,15 +6,7 @@ local workspace_map = {
|
||||
"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 monitor_count = #monitors
|
||||
|
||||
@@ -32,18 +24,13 @@ local function setup_monitors()
|
||||
default = i == 1,
|
||||
})
|
||||
|
||||
table.insert(
|
||||
monitor_binds,
|
||||
hl.bind(
|
||||
"SUPER + code:1" .. (i - 1),
|
||||
hl.dsp.focus({ workspace = "name:" .. workspace_name }),
|
||||
{ description = "Switch to workspace " .. workspace_map[i] }
|
||||
)
|
||||
)
|
||||
end
|
||||
|
||||
table.insert(
|
||||
monitor_binds,
|
||||
hl.bind("SUPER + SHIFT + code:1" .. (i - 1), function()
|
||||
local active_workspace = hl.get_active_workspace()
|
||||
local active_workspace_name = active_workspace.name
|
||||
@@ -53,7 +40,15 @@ local function setup_monitors()
|
||||
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
|
||||
|
||||
-- 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user