Adjust hyprland keybinds and better multimonitor xp
This commit is contained in:
@@ -6,3 +6,4 @@ require("hyprland.animations")
|
|||||||
require("hyprland.rules")
|
require("hyprland.rules")
|
||||||
require("hyprland.mcsr")
|
require("hyprland.mcsr")
|
||||||
require("hyprland.plugins")
|
require("hyprland.plugins")
|
||||||
|
require("monitors")
|
||||||
|
|||||||
+16
-7
@@ -37,8 +37,15 @@ local function select_window(n)
|
|||||||
table.sort(
|
table.sort(
|
||||||
windows,
|
windows,
|
||||||
function (a, b)
|
function (a, b)
|
||||||
return ((a.at.x^2 + a.at.y^2) * 1)
|
local mon = hl.get_active_monitor()
|
||||||
< ((b.at.x^2 + b.at.y^2) * 1)
|
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
|
end
|
||||||
)
|
)
|
||||||
return windows[n]
|
return windows[n]
|
||||||
@@ -102,18 +109,19 @@ bind('SUPER + P', hl.dsp.layout('togglesplit'))
|
|||||||
bind('SUPER + Y', hl.dsp.layout('swapsplit'))
|
bind('SUPER + Y', hl.dsp.layout('swapsplit'))
|
||||||
|
|
||||||
-- Special workspace
|
-- Special workspace
|
||||||
bind("SUPER + SEMICOLON", function ()
|
bind("SUPER + SHIFT + 0", function ()
|
||||||
if hl.get_active_special_workspace() == nil then
|
if hl.get_active_special_workspace() == nil then
|
||||||
hl.dispatch(hl.dsp.window.move({workspace = "special"}))
|
hl.dispatch(hl.dsp.window.move({workspace = "special"}))
|
||||||
else
|
else
|
||||||
hl.dispatch(hl.dsp.window.move({workspace = hl.get_active_workspace()}))
|
hl.dispatch(hl.dsp.window.move({workspace = hl.get_active_workspace()}))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
bind('SUPER + Q', hl.dsp.workspace.toggle_special())
|
bind('SUPER + 0', hl.dsp.workspace.toggle_special())
|
||||||
|
|
||||||
-- Multi monitor
|
-- Multi monitor
|
||||||
bind("SUPER + J", hl.dsp.focus({monitor = -1}))
|
bind("SUPER + Q", hl.dsp.focus({monitor = -1}))
|
||||||
bind("SUPER + SHIFT + J", hl.dsp.window.move({monitor = -1}))
|
bind("SUPER + SHIFT + Q", hl.dsp.window.move({monitor = -1}))
|
||||||
|
bind("SUPER + ALT + Q", hl.dsp.workspace.move({monitor = -1}))
|
||||||
|
|
||||||
-- Screen locking
|
-- Screen locking
|
||||||
bind("SUPER + ESCAPE", hl.dsp.exec_cmd("~/.config/scripts/lock.sh"), {locked = true})
|
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
|
-- Open favourites
|
||||||
bind("SUPER + G", hl.dsp.exec_cmd("zen-browser"))
|
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"))
|
bind("SUPER + L", hl.dsp.exec_cmd("kitty"))
|
||||||
|
|
||||||
-- Screen capturing
|
-- Screen capturing
|
||||||
|
|||||||
@@ -23,16 +23,3 @@ hl.device({
|
|||||||
name = "pixart-hp-usb-optical-mouse",
|
name = "pixart-hp-usb-optical-mouse",
|
||||||
enabled = true,
|
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 })
|
hl.window_rule({ match = { float = false, workspace = "f[1]s[false]" }, border_size = 0 })
|
||||||
|
|
||||||
-- For multiple monitors
|
-- For multiple monitors
|
||||||
|
hl.monitor({
|
||||||
|
output = "eDP-1",
|
||||||
|
scale = 1.0,
|
||||||
|
})
|
||||||
|
|
||||||
function map_monitors()
|
function map_monitors()
|
||||||
local monitor_priority = {
|
local monitor_priority = {
|
||||||
["eDP-1"] = -1
|
["DP-5"] = 1,
|
||||||
|
["HDMI-A-1"] = 4,
|
||||||
|
["eDP-1"] = 5
|
||||||
}
|
}
|
||||||
local monitors = hl.get_monitors()
|
local monitors = hl.get_monitors()
|
||||||
local nmonitors = #monitors
|
local nmonitors = #monitors
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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
|
||||||
|
})
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
[main]
|
[main]
|
||||||
leftmeta = layer(hyper)
|
leftmeta = layer(hyper)
|
||||||
capslock = layer(meta)
|
capslock = layer(meta)
|
||||||
rightalt = layer(alt)
|
|
||||||
|
|
||||||
[hyper]
|
[hyper]
|
||||||
j = left
|
j = left
|
||||||
@@ -21,9 +20,5 @@ n = C-left
|
|||||||
, = C-right
|
, = C-right
|
||||||
\ = command(killall steam)
|
\ = command(killall steam)
|
||||||
|
|
||||||
[alt]
|
|
||||||
[ = macro(A-left)
|
|
||||||
] = macro(A-right)
|
|
||||||
|
|
||||||
[shift]
|
[shift]
|
||||||
shift = capslock
|
shift = capslock
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ vim.cmd([[
|
|||||||
ino <c-t> <c-o>:
|
ino <c-t> <c-o>:
|
||||||
cno <c-h> <esc>
|
cno <c-h> <esc>
|
||||||
nn * o$ $<Left><Left>
|
nn * o$ $<Left><Left>
|
||||||
|
ino <C--> ^->
|
||||||
|
|
||||||
no <c-f> /
|
no <c-f> /
|
||||||
nn <enter> :noh<enter>
|
nn <enter> :noh<enter>
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
return {
|
return {
|
||||||
'm4xshen/autoclose.nvim',
|
'm4xshen/autoclose.nvim',
|
||||||
opts = { }
|
opts = {
|
||||||
|
keys = {
|
||||||
|
["$"] = {escape = true, close = true, pair = "$$", enabled_filetypes = {"typst"}}
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user