Adjust hyprland keybinds and better multimonitor xp
This commit is contained in:
+16
-7
@@ -37,8 +37,15 @@ local function select_window(n)
|
||||
table.sort(
|
||||
windows,
|
||||
function (a, b)
|
||||
return ((a.at.x^2 + a.at.y^2) * 1)
|
||||
< ((b.at.x^2 + b.at.y^2) * 1)
|
||||
local mon = hl.get_active_monitor()
|
||||
if mon == nil then return false end
|
||||
return (
|
||||
(a.at.x + a.size.x/2 - mon.position.x)^2 +
|
||||
(a.at.y + a.size.y/2 - mon.position.y)^2
|
||||
) < (
|
||||
(b.at.x + b.size.x/2 - mon.position.x)^2 +
|
||||
(b.at.y + b.size.y/2 - mon.position.y)^2
|
||||
)
|
||||
end
|
||||
)
|
||||
return windows[n]
|
||||
@@ -102,18 +109,19 @@ bind('SUPER + P', hl.dsp.layout('togglesplit'))
|
||||
bind('SUPER + Y', hl.dsp.layout('swapsplit'))
|
||||
|
||||
-- Special workspace
|
||||
bind("SUPER + SEMICOLON", function ()
|
||||
bind("SUPER + SHIFT + 0", function ()
|
||||
if hl.get_active_special_workspace() == nil then
|
||||
hl.dispatch(hl.dsp.window.move({workspace = "special"}))
|
||||
else
|
||||
hl.dispatch(hl.dsp.window.move({workspace = hl.get_active_workspace()}))
|
||||
end
|
||||
end)
|
||||
bind('SUPER + Q', hl.dsp.workspace.toggle_special())
|
||||
bind('SUPER + 0', hl.dsp.workspace.toggle_special())
|
||||
|
||||
-- Multi monitor
|
||||
bind("SUPER + J", hl.dsp.focus({monitor = -1}))
|
||||
bind("SUPER + SHIFT + J", hl.dsp.window.move({monitor = -1}))
|
||||
bind("SUPER + Q", hl.dsp.focus({monitor = -1}))
|
||||
bind("SUPER + SHIFT + Q", hl.dsp.window.move({monitor = -1}))
|
||||
bind("SUPER + ALT + Q", hl.dsp.workspace.move({monitor = -1}))
|
||||
|
||||
-- Screen locking
|
||||
bind("SUPER + ESCAPE", hl.dsp.exec_cmd("~/.config/scripts/lock.sh"), {locked = true})
|
||||
@@ -125,7 +133,8 @@ bind("switch:on:Lid Switch", hl.dsp.exec_cmd(
|
||||
|
||||
-- Open favourites
|
||||
bind("SUPER + G", hl.dsp.exec_cmd("zen-browser"))
|
||||
bind("SUPER + R", hl.dsp.exec_cmd("keepassxc"))
|
||||
bind("SUPER + C", hl.dsp.exec_cmd("vesktop"))
|
||||
bind("SUPER + R", hl.dsp.exec_cmd("flatpak run com.spotify.Client"))
|
||||
bind("SUPER + L", hl.dsp.exec_cmd("kitty"))
|
||||
|
||||
-- Screen capturing
|
||||
|
||||
Reference in New Issue
Block a user