-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisplay.nix
81 lines (69 loc) · 1.87 KB
/
display.nix
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{ pkgs, ... }:
{
fonts.enableDefaultPackages = true;
xdg.mime.enable = true;
xdg.portal = {
enable = true;
config = {
common = {
default = [ "gtk" ];
};
};
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};
programs.dconf.enable = true;
services.gvfs.enable = true;
services.dbus = {
enable = true;
packages = [ pkgs.dconf ];
};
services.displayManager.defaultSession = "none+i3";
services.xserver = {
enable = true;
xkb.layout = "us";
# replaced by kmonad
#xkb.options = "caps:escape";
# displayManager.sessionCommands = ''
# sleep 5 && ${pkgs.xorg.xset}/bin/xset r rate 250 66 &
# '';
# NOTE mutually exclusive with `services.displayManager.defaultSession`
# displayManager.startx.enable = true;
# run autostart programs
desktopManager.runXdgAutostartIfNone = true;
# use i3
windowManager.i3 = {
enable = true;
extraPackages = with pkgs; [
i3lock-fancy-rapid
xss-lock
];
};
};
# https://github.com/NixOS/nixpkgs/issues/34603
# https://wiki.archlinux.org/title/HiDPI
# https://ricostacruz.com/til/fractional-scaling-on-xorg-linux
services.xserver.dpi = 144; # bigger value -> larger elements
services.xserver.upscaleDefaultCursor = false;
environment.variables = {
# the following 2 variables work in conjunction with each other,
# GDK_SCALE allows doubling/tripling resolution (integer),
# while GDK_DPI_SCALE controls the text size (float)
GDK_SCALE = "1";
GDK_DPI_SCALE = "1";
_JAVA_OPTIONS = "-Dsun.java2d.uiScale=2.2";
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
XCURSOR_SIZE = "32";
};
environment.systemPackages = with pkgs; [
xorg.xset
xorg.setxkbmap
xorg.xinit
xorg.xrandr
xorg.xrdb
xorg.xprop
xorg.xeyes
xorg.xlsclients
xorg.xwininfo
xorg.xev
];
}