104 lines
2.0 KiB
TypeScript
104 lines
2.0 KiB
TypeScript
/**
|
|
* Generic variable interface for user-defined variables referenced elsewhere
|
|
* in the configuration
|
|
*/
|
|
export interface Vars {
|
|
[key: string]: string | number | boolean | Vars;
|
|
}
|
|
|
|
export interface ConfigFile {
|
|
vars?: Vars;
|
|
import?: string[];
|
|
outputs?: Outputs.Outputs;
|
|
layouts?: Layouts.Layouts;
|
|
contexts?: Contexts.Contexts;
|
|
workspaces?: Workspaces.Workspaces;
|
|
}
|
|
|
|
export namespace Outputs {
|
|
export interface Outputs {
|
|
[name: string]: Output;
|
|
}
|
|
|
|
export interface Criteria {
|
|
name?: string | string[];
|
|
make?: string;
|
|
model?: string;
|
|
serial?: string | number;
|
|
hostname?: string | string[];
|
|
modes: Partial<Mode>[];
|
|
}
|
|
|
|
export interface Mode {
|
|
width: number;
|
|
height: number;
|
|
refresh: number;
|
|
picture_aspect_ratio: string;
|
|
}
|
|
|
|
export interface Options
|
|
extends Partial<{
|
|
resolution: string;
|
|
refresh: string;
|
|
"custom-mode": string;
|
|
scale: number;
|
|
"calibration-profile": string;
|
|
"adaptive-sync": boolean;
|
|
"allow-tearing": boolean;
|
|
}> {}
|
|
|
|
export interface Output {
|
|
criteria: Criteria;
|
|
windows: string[] | Record<string, Record<string, string>>;
|
|
options: Options;
|
|
}
|
|
}
|
|
|
|
export namespace Workspaces {
|
|
export interface Workspaces {
|
|
[id: string]: Workspace;
|
|
}
|
|
|
|
export interface Workspace {
|
|
name: string;
|
|
application?: string;
|
|
exec?: string;
|
|
args?: string[];
|
|
environ?: Record<string, string>;
|
|
unit?: string;
|
|
systemd?: boolean;
|
|
"log-output"?: boolean;
|
|
}
|
|
}
|
|
|
|
export namespace Layouts {
|
|
export interface Layouts {
|
|
[name: string]: Layout;
|
|
}
|
|
|
|
export interface Layout {
|
|
[screenName: string]: Screen;
|
|
}
|
|
|
|
export interface Screen {
|
|
required?: boolean;
|
|
score?: number;
|
|
position: [x: string | number, y: string | number];
|
|
outputs: string[];
|
|
options?: Outputs.Options;
|
|
}
|
|
}
|
|
|
|
export namespace Contexts {
|
|
export interface Contexts {
|
|
[name: string]: Context;
|
|
}
|
|
|
|
export interface Context {
|
|
vars?: Vars;
|
|
groups: {
|
|
[screenName: string]: string[];
|
|
};
|
|
}
|
|
}
|