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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
- Theme presets for srdwm. Pick one by leaving its `apply(...)` call
- uncommented at the bottom and commenting out the others - exactly one
- should be active. Copying a whole preset table, editing values, and
- pointing the bottom call at the copy works too; nothing here is special
- beyond being a plain Lua table passed to srd.theme.set_colors/
- set_decorations.
--
- `border.inactive_dim` is a factor applied to `active_color` for the
- unfocused-window border, not a second explicit colour - 0.0 fades it to
- black, 1.0 makes it identical to focused. See docs/DEFAULTS.md.
--
- `border.width = 4`, not a thinner value: srdwm rounds the border's own
- corner via a CPU-rasterised bitmap, not a real-resolution GPU shader, so
- a 2px-thick strip only has 2 rows to draw a curve into - not enough to
- read as curved at all, just a slightly-softened square. 4px is the
-- minimum found actually visible as a real curve; go lower and the corner
- starts looking square again regardless of `radius`.
--
- `title_bar.height` below is *not* the real titlebar band - that's
- `srdwm_core::TITLEBAR_HEIGHT` (currently `32`), a compile-time constant
- shared between hit-testing and rendering so the two can never disagree.
- Kept here at the same value purely so this file doesn't read as
- disagreeing with the real height; changing it has no effect.
--
- `title_bar.button_style` - "traffic_lights" (default: filled, coloured
- macOS-style dots, zoom-arrow maximize) or "traditional" (plain glyphs
- straight on the titlebar background, no fill except a neutral hover
- backdrop, square maximize) - see `ThemeConfig::traffic_light_buttons`'s
- own doc comment. Independent of `button_side`: either style can sit on
- either side, though `traffic_lights` + left and `traditional` + right
- are this file's own two ready-made combinations below, matching macOS
- and Windows/GNOME convention respectively.
local srd = require("srd")
local function apply(preset)
srd.theme.set_colors(preset.colors)
srd.theme.set_decorations(preset.decorations)
end
- ---------------------------------------------------------------------
- Nord (dark) - srdwm's own compiled-in defaults (`ThemeConfig::
- default`), written out explicitly so the preset is visible and
- editable rather than left implicit.
- ---------------------------------------------------------------------
local nord = {
colors = {
background = "#2e3440",
foreground = "#eceff4",
primary = "#88c0d0",
secondary = "#81a1c1",
accent = "#5e81ac",
error = "#bf616a",
warning = "#ebcb8b",
success = "#a3be8c",
},
decorations = {
border = {
width = 4,
radius = 12,
active_color = "#88c0d0",
inactive_dim = 0.35,
},
title_bar = {
height = 32,
show = true,
background = "#2e3440",
foreground_focused = "#88c0d0",
foreground_unfocused = "#4c566a",
text_align = "left",
button_side = "right",
button_glyph = "hover",
},
},
}
- ---------------------------------------------------------------------
- macOS - centered title, left-aligned traffic-light buttons (real
- macOS convention, not this system's own GTK button-layout convention --
- see `title_bar.button_side`'s own doc comment in `crates/core/src/
- theme.rs` if picking a different button order/side). Grey titlebar
- background matches a real GTK dark theme's own CSD row (measured live
- off a real WhiteSur-Dark screenshot, (44,44,44)) rather than fighting
- it with an accent colour, so srdwm's own decorated windows read as the
- same family of chrome as Firefox/Nemo/every other GTK app's CSD, not a
- visibly different one sitting right next to them.
--
- For the *system* half of a full macOS look (which side Firefox/GTK
- apps' own CSD buttons draw on, real traffic-light gradients on GTK
- apps' own dots) see docs/DEFAULTS.md's "macOS look" section - that
- part is outside srdwm entirely (a `gsettings` value plus a userChrome.
- css/gtk.css of your own), so it isn't and can't be shipped from here.
- ---------------------------------------------------------------------
local macos = {
colors = {
background = "#1e1e1e",
foreground = "#f5f5f5",
primary = "#0a84ff",
secondary = "#5e5ce6",
accent = "#64d2ff",
error = "#ff453a",
warning = "#ffd60a",
success = "#32d74b",
},
decorations = {
border = {
width = 4,
radius = 12,
active_color = "#0a84ff",
inactive_dim = 0.35,
},
title_bar = {
height = 32,
show = true,
background = "#2c2c2c",
foreground_focused = "#f5f5f5",
foreground_unfocused = "#9a9a9a",
text_align = "center",
button_side = "left",
button_glyph = "hover",
},
},
}
- ---------------------------------------------------------------------
- Traditional - plain glyphs, right-aligned, no traffic lights: this
- project's own original look and the real Windows/GNOME convention, as
- distinct from `macos` above. Otherwise identical to `nord`; only
- `button_style` differs.
- ---------------------------------------------------------------------
local traditional = {
colors = nord.colors,
decorations = {
border = nord.decorations.border,
title_bar = {
height = 32,
show = true,
background = "#2e3440",
foreground_focused = "#88c0d0",
foreground_unfocused = "#4c566a",
text_align = "left",
button_side = "right",
button_glyph = "hover",
button_style = "traditional",
},
},
}
- Pick exactly one. Comment out the other two.
apply(nord)
- apply(macos)
- apply(traditional)
|