window title option
This commit is contained in:
@@ -51,4 +51,5 @@ if app_config is None:
|
|||||||
|
|
||||||
VINYL = app_config.get("vinyl", {"enable": False})
|
VINYL = app_config.get("vinyl", {"enable": False})
|
||||||
BATTERY = app_config.get("battery", {"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)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ from fabric.utils import (
|
|||||||
)
|
)
|
||||||
from fabric.widgets.circularprogressbar import CircularProgressBar
|
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):
|
class StatusBar(Window):
|
||||||
@@ -105,6 +105,10 @@ class StatusBar(Window):
|
|||||||
|
|
||||||
end_container_children.append(self.date_time)
|
end_container_children.append(self.date_time)
|
||||||
|
|
||||||
|
center_children = []
|
||||||
|
if WINDOW_TITLE["enable"]:
|
||||||
|
center_children.append(self.active_window)
|
||||||
|
|
||||||
self.children = CenterBox(
|
self.children = CenterBox(
|
||||||
name="bar-inner",
|
name="bar-inner",
|
||||||
start_children=Box(
|
start_children=Box(
|
||||||
@@ -120,7 +124,7 @@ class StatusBar(Window):
|
|||||||
name="center-container",
|
name="center-container",
|
||||||
spacing=4,
|
spacing=4,
|
||||||
orientation="h",
|
orientation="h",
|
||||||
children=[self.active_window],
|
children=center_children,
|
||||||
),
|
),
|
||||||
end_children=Box(
|
end_children=Box(
|
||||||
name="end-container",
|
name="end-container",
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
bar_height: 42
|
bar_height: 42
|
||||||
|
window_title:
|
||||||
|
enable: false
|
||||||
vinyl:
|
vinyl:
|
||||||
enable: true
|
enable: true
|
||||||
battery:
|
battery:
|
||||||
|
|||||||
12
flake.nix
12
flake.nix
@@ -82,17 +82,25 @@
|
|||||||
default = false;
|
default = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
bar_height = lib.mkOption {
|
height = lib.mkOption {
|
||||||
type = lib.types.int;
|
type = lib.types.int;
|
||||||
default = 40;
|
default = 40;
|
||||||
description = "Height of the status bar in pixels";
|
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 = {
|
default = {
|
||||||
vinyl.enable = false;
|
vinyl.enable = false;
|
||||||
battery.enable = false;
|
battery.enable = false;
|
||||||
bar_height = 40;
|
height = 40;
|
||||||
|
window_title.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user