aboutsummaryrefslogtreecommitdiff
path: root/working/hyprland-lua-port/velox-local.lua
blob: 1da735957537ef40f1b3c347d713f55549f552e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
-- velox — Framework 13, HiDPI 2256x1504. Sourced via conf.d/*.lua glob;
-- values here override hyprland.lua (last wins).

hl.monitor({
    output = "eDP-1",
    mode = "preferred",
    position = "auto",
    scale = "1.566667",
})

-- Scaling on this panel comes from the compositor alone.
--
-- There used to be `env = GDK_SCALE,1.5` and `env = QT_SCALE_FACTOR,1.5` here,
-- to compensate for `xwayland:force_zero_scaling = true` in hyprland.lua, which
-- makes XWayland clients render unscaled and therefore tiny. That worked for
-- XWayland and broke everything else, because env vars reach every app, not just
-- the XWayland ones. Qt 6 and GTK on Wayland already take their scale from the
-- compositor, so the factor multiplied the monitor scale above: Qt saw a 960x640
-- logical screen instead of 1440x960 and drew half again too large. Measured
-- with QScreen.geometry on 2026-08-19; 2256/1.566667 is exactly 1440, which is
-- what Qt reports once nothing overrides it.
--
-- Turning force_zero_scaling off for this host is the other half. XWayland then
-- scales through the compositor, so those apps come out the right size and a
-- little soft rather than sharp and tiny. That cost lands only on XWayland,
-- which is the thing I avoid anyway, and correctly-sized beats crisp for the
-- occasional Zoom window the browser spawns.
--
-- ratio needs neither: its monitor runs at scale 1, so nothing multiplies and
-- XWayland has nothing to compensate for.
hl.config({
    xwayland = {
        force_zero_scaling = false,
    },
})

-- calibre renders oversized at the 1.57 compositor scale. Pin its own DPI so its
-- UI is comfortable without touching the desktop or other apps (validated at 96,
-- 2026-06-27). CALIBRE_OVERRIDE_DPI is calibre-only, so a session-wide env is safe.
hl.env("CALIBRE_OVERRIDE_DPI", "96")
-- No XCURSOR_SIZE here: Hyprland scales the native cursor by the monitor scale
-- already, so the shared default (24) renders correctly on HiDPI. Pre-scaling it
-- (the old 36 = 24 x 1.5) double-applied on top of the compositor's scale.

-- org-capture popup: match the terminal scratchpad (75% x 70% of the 1437x958
-- logical desktop = 1078 x 671 px). Native window rules ignore percentages, so
-- it's pinned in pixels here rather than in the shared hyprland.lua.
hl.window_rule({
    match = {
        title = "^(org-capture)$",
    },
    size = "1078 671",
})

-- Growth cap (Craig, 2026-07-14): the frame must never outgrow its pinned
-- size even when capture content pushes it. 1078 px is ~98 Emacs columns,
-- already under the 120-column cap ratio uses.
hl.window_rule({
    match = {
        title = "^(org-capture)$",
    },
    max_size = "1078 671",
})