diff --git a/.config/hypr/autostart.lua b/.config/hypr/autostart.lua index c41f905..1349d32 100644 --- a/.config/hypr/autostart.lua +++ b/.config/hypr/autostart.lua @@ -12,5 +12,6 @@ end) hl.on('config.reloaded', function() toggle_laptop_monitor() + exec 'station-bg-random' end) diff --git a/.config/hypr/workspaces.lua b/.config/hypr/workspaces.lua index 0f0885d..5effd7a 100644 --- a/.config/hypr/workspaces.lua +++ b/.config/hypr/workspaces.lua @@ -69,3 +69,27 @@ hl.on('monitor.focused', set_laptop_workspace_to_monocle) hl.on('config.reloaded', set_laptop_workspace_to_monocle) +hl.on('window.open', function() + local windows = hl.get_windows() + for i = 1, #windows do + local win = windows[i] + if win.workspace.id > 0 then + hl.dispatch(hl.dsp.window.move { workspace = 'name:Home_1' }) + end + end +end) + +hl.on('workspace.active', function() + local monitors = hl.get_monitors() + local monitor_count = #monitors + + local workspace = get_active_workspace() + + if workspace and workspace.id > 0 then + for j = monitor_count, 1, -1 do + local monitor = monitors[j] + hl.dsp.focus { workspace = 'name:Home_' .. j } + end + end +end) +