Adjust hyprland keybinds and better multimonitor xp

This commit is contained in:
2026-10-14 10:54:37 -07:00
parent a09fe1c8a8
commit 639444e28d
10 changed files with 51 additions and 27 deletions
+1
View File
@@ -6,3 +6,4 @@ require("hyprland.animations")
require("hyprland.rules")
require("hyprland.mcsr")
require("hyprland.plugins")
require("monitors")
+16 -7
View File
@@ -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
-13
View File
@@ -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
})
+8 -1
View File
@@ -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
+4
View File
@@ -0,0 +1,4 @@
# Generated by nwg-displays on 2026-09-28 at 12:50:50. Do not edit manually.
monitor=eDP-1,1920x1200@60.0,360x1500,1.0,vrr,0
monitor=HDMI-A-1,2560x1440@59.95,0x0,1,vrr,0
+16
View File
@@ -0,0 +1,16 @@
-- Generated by nwg-displays on 2026-09-28 at 12:50:50. Do not edit manually.
hl.monitor({
output = "eDP-1",
mode = "1920x1200@60.0",
position = "360x1500",
scale = 1.0,
vrr = 0
})
hl.monitor({
output = "HDMI-A-1",
mode = "2560x1440@59.95",
position = "0x0",
scale = 1,
vrr = 0
})
View File
-5
View File
@@ -6,7 +6,6 @@
[main]
leftmeta = layer(hyper)
capslock = layer(meta)
rightalt = layer(alt)
[hyper]
j = left
@@ -21,9 +20,5 @@ n = C-left
, = C-right
\ = command(killall steam)
[alt]
[ = macro(A-left)
] = macro(A-right)
[shift]
shift = capslock
+1
View File
@@ -62,6 +62,7 @@ vim.cmd([[
ino <c-t> <c-o>:
cno <c-h> <esc>
nn * o$ $<Left><Left>
ino <C--> ^->
no <c-f> /
nn <enter> :noh<enter>
+5 -1
View File
@@ -1,4 +1,8 @@
return {
'm4xshen/autoclose.nvim',
opts = { }
opts = {
keys = {
["$"] = {escape = true, close = true, pair = "$$", enabled_filetypes = {"typst"}}
},
}
}