1
1
Fork 0

hyprland: fix resolution rules

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2024-09-14 19:58:03 -05:00
parent 082ec5cd76
commit 1aceee6e23
Signed by: myned
GPG key ID: C7224454F7881A34

View file

@ -38,40 +38,70 @@ in {
# https://wiki.hyprland.org/Configuring/Window-Rules # https://wiki.hyprland.org/Configuring/Window-Rules
#?? windowrulev2 = RULE, WINDOW #?? windowrulev2 = RULE, WINDOW
windowrulev2 = with config.custom; let windowrulev2 = with config.custom; let
### Hardware-dependent rules # HACK: Attempts to account for hypr-specific scale, gaps, borders, and bar padding
# Convert truncated float to string ### Static geometry rules
tr = num: toString (builtins.floor num); tr = num: toString (builtins.floor num); # Convert truncated float to string
# Bottom center # Bottom center
clipboard = rec { clipboard = rec {
x = tr (width / scale / 2 - (toInt w) / 2); x = tr (width / scale / 2 - (toInt w) / 2);
y = tr (height / scale - (toInt h) - gap - border - padding); y = tr (height
/ scale
- (toInt h)
- gap
- padding
+ (
if ultrawide
then - border # Cause unknown
else 0
));
w = "600"; w = "600";
h = tr (height / scale * 0.5 * scale); h = tr (height / scale * 0.75); # 75%
}; };
# Bottom center # Bottom center
dropdown = rec { dropdown = rec {
x = tr (width / scale / 2 - (toInt w) / 2); x = tr (width / scale / 2 - (toInt w) / 2);
y = tr (height / scale - (toInt h) - gap - border - padding); y = tr (height
w = tr (width / scale
- (toInt h)
- gap
- padding
+ (
if ultrawide
then - border # Cause unknown
else 0
));
w = tr (
width
/ scale / scale
* ( * (
if ultrawide if ultrawide
then 0.5 then 0.5 # 50%
else 1 else 1
) )
- gap + (
- gap / 2 if ultrawide
+ 1); then - gap / 2 * 2 # Center layout padding between windows
h = tr (height / scale * 0.2 * scale); else 0
)
- gap * 2
- border * 2
);
h = tr (height
/ scale
* (
if ultrawide
then 0.2 # 20%
else 0.3 # 30%
));
}; };
# Top right # Top right
pip = rec { pip = rec {
x = tr (width / scale - (toInt w) - gap - border); x = tr (width / scale - (toInt w) - gap - border);
y = tr (gap + border); y = tr (gap + border);
w = tr (width / scale * 0.25 - gap - gap + 1); w = tr (width / scale * 0.25 - gap - gap / 2 - border * 2); # 25%
h = tr ((toInt w) * 9 / 16); # 16:9 aspect ratio h = tr ((toInt w) * 9 / 16); # 16:9 aspect ratio
}; };