diff --git a/hypr/hyprland.lua b/hypr/hyprland.lua index da5ef8d..630daec 100644 --- a/hypr/hyprland.lua +++ b/hypr/hyprland.lua @@ -6,3 +6,4 @@ require("hyprland.animations") require("hyprland.rules") require("hyprland.mcsr") require("hyprland.plugins") +require("monitors") diff --git a/hypr/hyprland/binds.lua b/hypr/hyprland/binds.lua index daa0d49..f14c1ac 100644 --- a/hypr/hyprland/binds.lua +++ b/hypr/hyprland/binds.lua @@ -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 diff --git a/hypr/hyprland/hardware/sparrow.lua b/hypr/hyprland/hardware/sparrow.lua index c23380c..95e78b3 100644 --- a/hypr/hyprland/hardware/sparrow.lua +++ b/hypr/hyprland/hardware/sparrow.lua @@ -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 -}) diff --git a/hypr/hyprland/rules.lua b/hypr/hyprland/rules.lua index 1560007..0129f3f 100644 --- a/hypr/hyprland/rules.lua +++ b/hypr/hyprland/rules.lua @@ -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 diff --git a/hypr/monitors.conf b/hypr/monitors.conf new file mode 100644 index 0000000..3d24919 --- /dev/null +++ b/hypr/monitors.conf @@ -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 diff --git a/hypr/monitors.lua b/hypr/monitors.lua new file mode 100644 index 0000000..e87d1d6 --- /dev/null +++ b/hypr/monitors.lua @@ -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 +}) diff --git a/hypr/workspaces.conf b/hypr/workspaces.conf new file mode 100644 index 0000000..e69de29 diff --git a/main.conf b/main.conf index 0666a12..e05b625 100644 --- a/main.conf +++ b/main.conf @@ -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 diff --git a/nvim/init.lua b/nvim/init.lua index ec28c68..d8468bc 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -62,6 +62,7 @@ vim.cmd([[ ino : cno nn * o$ $ + ino ^-> no / nn :noh diff --git a/nvim/lua/plugins/autoclose.lua b/nvim/lua/plugins/autoclose.lua index c86cd74..e283b62 100644 --- a/nvim/lua/plugins/autoclose.lua +++ b/nvim/lua/plugins/autoclose.lua @@ -1,4 +1,8 @@ return { 'm4xshen/autoclose.nvim', - opts = { } + opts = { + keys = { + ["$"] = {escape = true, close = true, pair = "$$", enabled_filetypes = {"typst"}} + }, + } }