Workspaces
This commit is contained in:
@@ -22,19 +22,23 @@ local function setup_monitors()
|
|||||||
for i = 1, 5 do
|
for i = 1, 5 do
|
||||||
for j = monitor_count, 1, -1 do
|
for j = monitor_count, 1, -1 do
|
||||||
local monitor = monitors[j]
|
local monitor = monitors[j]
|
||||||
local workspace_id = "name:" .. workspace_map[i] .. "_" .. j
|
-- local workspace_id = "name:" .. workspace_map[i] .. "_" .. j
|
||||||
hl.notification.create({ text = workspace_id, duration = 2000 })
|
local workspace_id = (i - 1) * monitor_count + j
|
||||||
|
local workspace_name = workspace_map[i] .. "_" .. j
|
||||||
hl.workspace_rule({
|
hl.workspace_rule({
|
||||||
workspace = tostring(workspace_id),
|
workspace = workspace_id,
|
||||||
|
default_name = workspace_name,
|
||||||
monitor = monitor.name,
|
monitor = monitor.name,
|
||||||
|
default = i == 1,
|
||||||
})
|
})
|
||||||
|
|
||||||
table.insert(
|
table.insert(
|
||||||
monitor_binds,
|
monitor_binds,
|
||||||
hl.bind("SUPER + code:1" .. (i - 1), function()
|
hl.bind(
|
||||||
hl.dsp.focus({ workspace = workspace_id })
|
"SUPER + code:1" .. (i - 1),
|
||||||
hl.notification.create({ text = workspace_id, duration = 2000 })
|
hl.dsp.focus({ workspace = "name:" .. workspace_name }),
|
||||||
end, { description = "Switch to workspace " .. workspace_map[i] })
|
{ description = "Switch to workspace " .. workspace_map[i] }
|
||||||
|
)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -45,6 +49,7 @@ local function setup_monitors()
|
|||||||
local active_workspace_name = active_workspace.name
|
local active_workspace_name = active_workspace.name
|
||||||
local monitor_suffix = active_workspace_name:match("_(%d+)$") or "1"
|
local monitor_suffix = active_workspace_name:match("_(%d+)$") or "1"
|
||||||
local new_workspace = "name:" .. workspace_map[i] .. "_" .. monitor_suffix
|
local new_workspace = "name:" .. workspace_map[i] .. "_" .. monitor_suffix
|
||||||
|
-- local new_workspace = (i - 1) * monitor_count + active_workspace.id
|
||||||
hl.notification.create({ text = new_workspace, duration = 2000 })
|
hl.notification.create({ text = new_workspace, duration = 2000 })
|
||||||
hl.dispatch(hl.dsp.window.move({ workspace = new_workspace, follow = false }))
|
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] })
|
||||||
|
|||||||
+14
-23
@@ -17,33 +17,24 @@
|
|||||||
"hyprland/workspaces": {
|
"hyprland/workspaces": {
|
||||||
"on-click": "activate",
|
"on-click": "activate",
|
||||||
"format": "{icon}",
|
"format": "{icon}",
|
||||||
|
"sort-by": "id",
|
||||||
"format-icons": {
|
"format-icons": {
|
||||||
"default": "",
|
"default": "",
|
||||||
"1": "",
|
"Home_1": "",
|
||||||
"2": "",
|
"Dev_1": "",
|
||||||
"3": "",
|
"Art_1": "",
|
||||||
"4": "",
|
"Gaming_1": "",
|
||||||
"5": "",
|
"Writing_1": "",
|
||||||
"6": "",
|
"Home_2": "",
|
||||||
"7": "",
|
"Dev_2": "",
|
||||||
"8": "",
|
"Art_2": "",
|
||||||
"9": "",
|
"Gaming_2": "",
|
||||||
"10": "",
|
"Writing_2": "",
|
||||||
"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": ["name:Home_1", "name:Dev_1", "name:Art_1", "name:Gaming_1", "name:Writing_1"],
|
"eDP-1": ["Home_1", "Dev_1", "Art_1", "Gaming_1", "Writing_1"],
|
||||||
"DP-1": ["name:Home_1", "name:Dev_1", "name:Art_1", "name:Gaming_1", "name:Writing_1"],
|
"DP-1": ["Home_1", "Dev_1", "Art_1", "Gaming_1", "Writing_1"],
|
||||||
"DP-2": ["name:Home_2", "name:Dev_2", "name:Art_2", "name:Gaming_2", "name:Writing_2"],
|
"DP-2": ["Home_2", "Dev_2", "Art_2", "Gaming_2", "Writing_2"],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"custom/station": {
|
"custom/station": {
|
||||||
|
|||||||
Reference in New Issue
Block a user