config.go RawHistoryFolder
1package ports
2
3// OutputConfig configures one connector. Name is the connector (e.g. "DP-2").
4// Mode is "WxH" (highest refresh) or "WxH@Hz" (closest refresh); empty picks the
5// monitor's preferred mode. Off disables the connector.
6// Every connected output that is not off is used. Outputs are placed left to
7// right in config order, then in connection order.
8// Scale is the output scale (0 means 1); layout works in logical pixels,
9// physical = logical × Scale.
10// Primary gets the focus and the pointer at startup, wherever it is placed.
11// ScaleOnly marks an entry set by output.<name>.scale or .primary alone: it
12// does not select the connector.
13type OutputConfig struct {
14 Name string
15 Mode string
16 Off bool
17 Scale float64
18 Primary bool
19 ScaleOnly bool
20}
21
22// Config is the parsed compositor configuration (see the config adapter for keys).
23type Config struct {
24 Keyboard struct {
25 Layout, Variant, Options string
26 RepeatRate int
27 RepeatDelay int
28 CmdKey string
29 }
30 Terminal struct{ Command []string }
31 // Xwayland is the xwayland-satellite binary serving X11 clients; empty
32 // disables X11.
33 Xwayland string
34 // Startup are commands run once when the session starts, in order.
35 Startup [][]string
36 Background struct{ Color string }
37 // Border is drawn inside the window edge; Width 0 disables it.
38 Border struct {
39 Width int
40 Active string
41 Inactive string
42 }
43 Layout struct {
44 Gaps int
45 // MaxColumns is how many columns share the screen before scrolling.
46 MaxColumns int
47 Presets []string
48 // Overflow is "scroll" or "fixed" (see WorkspaceConfig).
49 Overflow string
50 }
51 Focus struct {
52 // FollowMove shows the target workspace after a column or window
53 // moves to it.
54 FollowMove bool
55 }
56 // Workspaces are declared with workspace.<name>.* keys, in first-seen order.
57 Workspaces []WorkspaceConfig
58 // Outputs selects and configures physical displays (drm backend).
59 Outputs []OutputConfig
60 Binds map[string]string
61 Render struct {
62 DirectScanout bool
63 // Tearing honours wp_tearing_control_v1 in direct scanout; VRR
64 // turns variable refresh on while a buffer is scanned out.
65 Tearing, VRR bool
66 }
67 Log struct {
68 Level string
69 Debug []string
70 }
71}
72
73// WorkspaceConfig declares a named workspace. Hidden ones are not numbered and
74// only reachable through a `workspace <name>` bind, which toggles them.
75// Zero MaxColumns and an empty Overflow use the layout.* defaults.
76type WorkspaceConfig struct {
77 Name string
78 // Monitor is the home monitor: a connector name (DP-2) or a monitor key
79 // ("make model serial"); empty means the first output.
80 Monitor string
81 // Slots are the declared columns (workspace.<name>.column.N), by N.
82 Slots []SlotConfig
83 Hidden bool
84 MaxColumns int
85 Overflow string
86}
87
88// SlotConfig reserves column N of a workspace for the window of one command.
89// neferwl spawns the command at startup; the window it opens goes to the
90// slot. Width is a layout width (fraction, percentage or pixels).
91type SlotConfig struct {
92 Index int
93 Width string
94 Argv []string
95}