File tree Expand file tree Collapse file tree 4 files changed +52
-5
lines changed Expand file tree Collapse file tree 4 files changed +52
-5
lines changed Original file line number Diff line number Diff line change 2
2
monitor = [
3
3
",preferred,auto,auto"
4
4
] ;
5
- xwayland = {
6
- force_zero_scaling = true ;
7
- } ;
8
5
}
Original file line number Diff line number Diff line change
1
+ { pkgs , ...} : {
2
+ services . xsettingsd = {
3
+ enable = true ;
4
+ settings = {
5
+ "Gdk/UnscaledDPI" = 98304 ;
6
+ "Gdk/WindowScalingFactor" = 2 ;
7
+ } ;
8
+ } ;
9
+ home . packages = with pkgs . xorg ; [
10
+ xrdb
11
+ xprop
12
+ ] ;
13
+ wayland . windowManager . hyprland . settings = {
14
+ exec-once = [ "echo \" Xft.dpi: 192\" | xrdb -merge && xprop -root -format _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2" ] ;
15
+ xwayland . use_nearest_neighbor = false ;
16
+ } ;
17
+ home . sessionVariables . HIDPI_XPROP = 1 ; # for xwayland app detecting scaling
18
+ }
Original file line number Diff line number Diff line change 4
4
isVM ,
5
5
...
6
6
} : {
7
+ imports = [ ./hidpi-xprop.nix ] ;
8
+
7
9
wayland . windowManager . hyprland = {
8
10
enable = true ;
9
11
# set the flake package
Original file line number Diff line number Diff line change 1
1
{
2
2
inputs ,
3
+ lib ,
3
4
pkgs ,
4
5
...
5
- } : {
6
+ } : let
7
+ # use patch to support scaling xwayland windows
8
+ hyprland-patch = pkgs . fetchpatch {
9
+ name = "hyprland-hidpi-xprop.patch" ;
10
+ url = "https://patch-diff.githubusercontent.com/raw/hyprwm/Hyprland/pull/6446.patch" ;
11
+ hash = "sha256-60g1EvEoa/733teiMSdUCxfgrwfc/JgWTcDN49D74V4=" ;
12
+ } ;
13
+ xwayland-patch = pkgs . fetchpatch {
14
+ name = "xwayland-hidpi-xprop.patch" ;
15
+ url = "https://aur.archlinux.org/cgit/aur.git/plain/hidpi.patch?h=xorg-xwayland-hidpi-xprop" ;
16
+ hash = "sha256-wAsBSyp0B52jC586lDWBV6TTkLuQqEr3juOEus83GTo=" ;
17
+ } ;
18
+ xwayland = pkgs . xwayland . overrideAttrs ( previousArgs : {
19
+ patches = [ xwayland-patch ] ;
20
+ mesonFlags =
21
+ previousArgs . mesonFlags
22
+ ++ [
23
+ ( lib . mesonBool "xvfb" false )
24
+ ( lib . mesonBool "xdmcp" false )
25
+ ] ;
26
+ } ) ;
27
+ in {
6
28
nix . settings = {
7
29
# Hyprland cachix
8
30
substituters = [ "https://hyprland.cachix.org" ] ;
13
35
enable = true ;
14
36
withUWSM = true ;
15
37
16
- package = inputs . hyprland . packages . ${ pkgs . stdenv . hostPlatform . system } . hyprland ;
38
+ package =
39
+ ( inputs . hyprland . packages . ${ pkgs . stdenv . hostPlatform . system } . hyprland . overrideAttrs {
40
+ patches = [ hyprland-patch ] ;
41
+ } )
42
+ . override {
43
+ inherit xwayland ;
44
+ } ;
17
45
portalPackage = inputs . hyprland . packages . ${ pkgs . stdenv . hostPlatform . system } . xdg-desktop-portal-hyprland ;
18
46
} ;
47
+ environment . systemPackages = [ xwayland ] ; # add patched xwayland to path, idkw it cant be added automatically in hyprland drv
48
+
19
49
environment . sessionVariables . NIXOS_OZONE_WL = "1" ;
20
50
}
You can’t perform that action at this time.
0 commit comments