dot

vizie's NixOS desktop: Hyprland, CachyOS kernel and gaming tweaks

91 lines3194 bytesLua
1-- gtkgreet runs as a full-screen layer (-l); blur the wallpaper behind it so the
2-- login screen looks like hyprlock (blur 5/2 + dim from style.css).
3hl.layer_rule({
4 match = {
5 namespace = "gtk-layer-shell",
6 },
7 blur = true,
8 ignore_alpha = 0,
9})
10
11hl.monitor({
12 output = "HDMI-A-2",
13 mode = "2560x1440@280",
14 position = "0x0",
15 scale = 1,
16 vrr = 0,
17})
18
19hl.monitor({
20 output = "DP-1",
21 disabled = true,
22})
23
24-- Same cursor as the desktop session. The greeter user has no settings of its
25-- own, so without this Hyprland falls back to the default (Adwaita) cursor.
26-- gtkgreet's own window reads GNOME's cursor setting instead; that default comes
27-- from greetd/99_greeter-cursor.gschema.override in /usr/share/glib-2.0/schemas.
28hl.env("XCURSOR_THEME", "BreezeX-Black")
29hl.env("XCURSOR_SIZE", "28")
30
31hl.config({
32 misc = {
33 disable_hyprland_logo = true,
34 disable_splash_rendering = true,
35 -- Wallpaper's average colour (dimmed like style.css) instead of black,
36 -- shown for the moment before hyprpaper has drawn the wallpaper.
37 background_color = "rgb(0d1513)",
38 },
39 general = {
40 border_size = 2,
41 gaps_in = 5,
42 gaps_out = 17,
43 layout = "dwindle",
44 col = {
45 active_border = "rgb(aaffff)",
46 inactive_border = "rgba(00000000)",
47 },
48 },
49 decoration = {
50 rounding = 10,
51 blur = {
52 enabled = true,
53 size = 5,
54 passes = 2,
55 new_optimizations = true,
56 },
57 shadow = {
58 enabled = false,
59 render_power = 3,
60 range = 4,
61 color = "rgba(1a1a1aee)",
62 },
63 },
64 input = {
65 kb_layout = "no",
66 follow_mouse = 1,
67 sensitivity = 0,
68 accel_profile = "flat",
69 },
70 debug = {
71 disable_logs = false,
72 },
73})
74
75-- Login screen fades in over the wallpaper and out again when you log in.
76hl.curve("easeOutQuint", { type = "bezier", points = { {0.23, 1}, {0.32, 1} } })
77hl.curve("almostLinear", { type = "bezier", points = { {0.5, 0.5}, {0.75, 1} } })
78hl.animation({ leaf = "layersIn", enabled = true, speed = 5, bezier = "easeOutQuint", style = "fade" })
79hl.animation({ leaf = "fadeLayersIn", enabled = true, speed = 5, bezier = "almostLinear" })
80hl.animation({ leaf = "layersOut", enabled = true, speed = 3, bezier = "almostLinear", style = "fade" })
81hl.animation({ leaf = "fadeLayersOut", enabled = true, speed = 3, bezier = "almostLinear" })
82
83hl.on("hyprland.start", function()
84 hl.exec_cmd("hyprpaper -c /etc/greetd/hyprpaper.conf")
85 -- gtkgreet exits once the login succeeds: let its fade-out finish, stop
86 -- hyprpaper (it segfaults if the compositor disappears under it), then quit
87 -- this Hyprland cleanly so greetd starts the session right away. Without this
88 -- the greeter got killed and Hyprland/hyprpaper/portals crashed on the way out.
89 hl.exec_cmd("gtkgreet -l -c /etc/greetd/session.sh -s /etc/greetd/style.css; sleep 0.35; pkill -xf 'hyprpaper -c /etc/greetd/hyprpaper.conf'; sleep 0.1; hyprctl dispatch 'hl.dsp.exit()'")
90 hl.exec_cmd("kitty")
91end)