diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-02 22:12:06 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-02 22:12:06 +1100 |
| commit | 579070733cf9605e96f045158ba56dcc5a9fdb80 (patch) | |
| tree | 609af68ebfa294c5cb25822a9074dcbb3e93af0e /src/config/types.ts | |
| parent | notifpopups: fix clicking opening sidebar (diff) | |
| download | caelestia-shell-579070733cf9605e96f045158ba56dcc5a9fdb80.tar.gz caelestia-shell-579070733cf9605e96f045158ba56dcc5a9fdb80.tar.bz2 caelestia-shell-579070733cf9605e96f045158ba56dcc5a9fdb80.zip | |
feat: define bar layout via config
Diffstat (limited to 'src/config/types.ts')
| -rw-r--r-- | src/config/types.ts | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/src/config/types.ts b/src/config/types.ts index c5baf99..f5ca03a 100644 --- a/src/config/types.ts +++ b/src/config/types.ts @@ -1,9 +1,25 @@ const BOOL = "boolean"; const STR = "string"; const NUM = "number"; -const ARR = (type: string) => `array of ${type}`; +const ARR = (type: string | string[]) => `array of ${typeof type === "string" ? type : JSON.stringify(type)}`; const OBJ_ARR = (shape: object) => ARR(JSON.stringify(shape)); +const barModules = [ + "osIcon", + "activeWindow", + "mediaPlaying", + "brightnessSpacer", + "workspaces", + "volumeSpacer", + "tray", + "statusIcons", + "pkgUpdates", + "notifCount", + "battery", + "dateTime", + "power", +]; + export default { "style.transparency": ["off", "normal", "high"], "style.borders": BOOL, @@ -11,20 +27,14 @@ export default { // Bar "bar.vertical": BOOL, "bar.style": ["gaps", "panel", "embedded"], - "bar.modules.osIcon.enabled": BOOL, - "bar.modules.activeWindow.enabled": BOOL, - "bar.modules.mediaPlaying.enabled": BOOL, - "bar.modules.workspaces.enabled": BOOL, + "bar.layout.type": ["centerbox", "flowbox"], + "bar.layout.centerbox.start": ARR(barModules), + "bar.layout.centerbox.center": ARR(barModules), + "bar.layout.centerbox.end": ARR(barModules), + "bar.layout.flowbox": ARR(barModules), "bar.modules.workspaces.shown": NUM, - "bar.modules.tray.enabled": BOOL, - "bar.modules.statusIcons.enabled": BOOL, - "bar.modules.pkgUpdates.enabled": BOOL, - "bar.modules.notifCount.enabled": BOOL, - "bar.modules.battery.enabled": BOOL, - "bar.modules.dateTime.enabled": BOOL, "bar.modules.dateTime.format": STR, "bar.modules.dateTime.detailedFormat": STR, - "bar.modules.power.enabled": BOOL, // Launcher "launcher.style": ["lines", "round"], "launcher.actionPrefix": STR, |