From 7ca06e60f1a6f5a005b4da07ceb5ede267644161 Mon Sep 17 00:00:00 2001 From: Rosty Hnatyshyn Date: Mon, 12 Oct 2026 10:07:47 -0700 Subject: [PATCH] add better fullscreen workaround, move monitors into separate file --- hypr/.gitignore | 1 + hypr/hyprland.lua | 28 +++++++++++----------------- 2 files changed, 12 insertions(+), 17 deletions(-) create mode 100644 hypr/.gitignore diff --git a/hypr/.gitignore b/hypr/.gitignore new file mode 100644 index 0000000..20d2469 --- /dev/null +++ b/hypr/.gitignore @@ -0,0 +1 @@ +monitors.lua diff --git a/hypr/hyprland.lua b/hypr/hyprland.lua index b9a3c6d..3ed0c30 100644 --- a/hypr/hyprland.lua +++ b/hypr/hyprland.lua @@ -12,20 +12,7 @@ hl.env("HYPRCURSOR_SIZE", "24") -- hl.env("DISPLAY", ":0") -- hl.env("USE_X11", "false") --- monitors -hl.monitor({ - output = "HDMI-A-2", - mode = "2560x1440@143.99899", - position = "1920x0", - scale = "1.25", -}) - -hl.monitor({ - output = "DP-4", - mode = "1920x1080@143.99", - position = "0x0", - scale = "auto", -}) +require("monitors") local home = os.getenv("HOME") @@ -167,9 +154,16 @@ hl.bind(mainMod .. " + SPACE", hl.dsp.window.float({ action = "toggle" })) -- toggle maximize in scrolling mode; from https://github.com/hyprwm/Hyprland/discussions/14380 hl.bind(mainMod .. " + F", function() - hl.dispatch(hl.dsp.layout("colresize +conf")) - hl.dispatch(hl.dsp.layout("focus r")) - hl.dispatch(hl.dsp.layout("focus l")) + local monitor = hl.get_active_monitor() + local window = hl.get_active_window() + + if monitor and window and type(window.size) == "table" then + if window.size.x >= monitor.width / 2 then + hl.dispatch(hl.dsp.layout("colresize 0.5")) + else + hl.dispatch(hl.dsp.layout("colresize 1")) + end + end end ) hl.bind(mainMod .. " + SHIFT + Q", hl.dsp.window.close())