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
|
||||
|
||||
@@ -23,16 +23,3 @@ hl.device({
|
||||
name = "pixart-hp-usb-optical-mouse",
|
||||
enabled = true,
|
||||
})
|
||||
|
||||
hl.monitor({
|
||||
output = "eDP-1",
|
||||
mode = "preferred",
|
||||
scale = 1
|
||||
})
|
||||
|
||||
hl.monitor({
|
||||
output = "",
|
||||
mode = "preferred",
|
||||
position = "auto",
|
||||
scale = 1
|
||||
})
|
||||
|
||||
@@ -5,9 +5,16 @@ hl.window_rule({ match = { float = false, workspace = "w[tv1]s[false]" }, border
|
||||
hl.window_rule({ match = { float = false, workspace = "f[1]s[false]" }, border_size = 0 })
|
||||
|
||||
-- For multiple monitors
|
||||
hl.monitor({
|
||||
output = "eDP-1",
|
||||
scale = 1.0,
|
||||
})
|
||||
|
||||
function map_monitors()
|
||||
local monitor_priority = {
|
||||
["eDP-1"] = -1
|
||||
["DP-5"] = 1,
|
||||
["HDMI-A-1"] = 4,
|
||||
["eDP-1"] = 5
|
||||
}
|
||||
local monitors = hl.get_monitors()
|
||||
local nmonitors = #monitors
|
||||
|
||||
Reference in New Issue
Block a user