window title option

This commit is contained in:
2025-09-29 11:02:48 +02:00
parent 1a24c4eb99
commit d9a176d4ec
4 changed files with 20 additions and 5 deletions

View File

@@ -51,4 +51,5 @@ if app_config is None:
VINYL = app_config.get("vinyl", {"enable": False})
BATTERY = app_config.get("battery", {"enable": False})
BAR_HEIGHT = app_config.get("bar_height", 40)
WINDOW_TITLE = app_config.get("window_title", {"enable": True})
BAR_HEIGHT = app_config.get("height", 40)

View File

@@ -20,7 +20,7 @@ from fabric.utils import (
)
from fabric.widgets.circularprogressbar import CircularProgressBar
from bar.config import VINYL, BATTERY, BAR_HEIGHT
from bar.config import VINYL, BATTERY, BAR_HEIGHT, WINDOW_TITLE
class StatusBar(Window):
@@ -105,6 +105,10 @@ class StatusBar(Window):
end_container_children.append(self.date_time)
center_children = []
if WINDOW_TITLE["enable"]:
center_children.append(self.active_window)
self.children = CenterBox(
name="bar-inner",
start_children=Box(
@@ -120,7 +124,7 @@ class StatusBar(Window):
name="center-container",
spacing=4,
orientation="h",
children=[self.active_window],
children=center_children,
),
end_children=Box(
name="end-container",

View File

@@ -1,4 +1,6 @@
bar_height: 42
window_title:
enable: false
vinyl:
enable: true
battery:

View File

@@ -82,17 +82,25 @@
default = false;
};
};
bar_height = lib.mkOption {
height = lib.mkOption {
type = lib.types.int;
default = 40;
description = "Height of the status bar in pixels";
};
window_title = {
enable = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Whether to show the window title in the center of the bar";
};
};
};
};
default = {
vinyl.enable = false;
battery.enable = false;
bar_height = 40;
height = 40;
window_title.enable = true;
};
};
};