Skip to main content

max / alloy

2.2 KB · 47 lines History Blame Raw
1 # Alloy console palette — point the Linux console's sixteen ANSI slots at Akari.
2 #
3 # The greeter (tuigreet, on VT1) runs on a raw Linux virtual console, before
4 # any Wayland session or terminal emulator exists. tuigreet can only name ANSI
5 # colors (container=white, text=black, prompt=yellow, ...), so the first
6 # surface a user sees on boot is themed entirely by what those sixteen console
7 # slots hold. Left alone they are the kernel's stock palette, and login renders
8 # in generic console colors that then jump into Akari at session start.
9 #
10 # setvtrgb rewrites the console color map, which is a single global map the VT
11 # subsystem shares across every console including ones allocated later, so one
12 # invocation before the first text surface is enough. The map file is generated
13 # at image-build time from the default light theme (skelgen, from the same ANSI
14 # table the kernel cmdline's vt.default_* arrays and the terminal emulator both
15 # render from); this unit only applies it.
16 #
17 # systemd-vconsole-setup owns the console font and keymap and does not touch
18 # the color map, so ordering after it is for cleanliness, not conflict. The
19 # Before= list covers every text surface that can paint on a console: greetd on
20 # VT1, and any getty (other VTs, and the alloy-debug-shell, which also orders
21 # before getty.target).
22 #
23 # Not yet verified on hardware: that setvtrgb, run from a unit with no
24 # controlling terminal, reaches the console it opens on this image, and that
25 # the greeter comes up on the Akari tones. Both are the live-boot checks the
26 # GoingsOn greeter task carries.
27
28 [Unit]
29 Description=Alloy console palette (Akari)
30 Documentation=man:setvtrgb(8)
31 After=systemd-vconsole-setup.service
32 Before=greetd.service getty.target
33 # The map is a pure build artifact and setvtrgb ships in kbd; if either is
34 # absent the palette silently stays stock, which the build-time asserts in the
35 # Containerfile exist to prevent. The conditions here keep the unit from
36 # failing loudly on a hand-modified image where they were removed.
37 ConditionPathExists=/usr/bin/setvtrgb
38 ConditionPathExists=/usr/share/alloy/vtrgb
39
40 [Service]
41 Type=oneshot
42 RemainAfterExit=yes
43 ExecStart=/usr/bin/setvtrgb /usr/share/alloy/vtrgb
44
45 [Install]
46 WantedBy=multi-user.target
47