fix window title visibility and elision, document weather.interval

This commit is contained in:
Damocles 2026-04-17 00:54:05 +02:00
parent e1565bdd59
commit 25bc3954cb
3 changed files with 9 additions and 3 deletions

View file

@ -88,6 +88,7 @@ programs.nova-shell.modules = {
# modules with extra config
backlight.step = 2; # brightness adjustment %
weather.args = [ "--nerd" "--location" "Berlin" ]; # wttrbar arguments
weather.interval = 3600000; # refresh interval in ms (default 1h)
temperature.warm = 55; # °C threshold for warm color
temperature.hot = 75; # °C threshold for hot color
battery.warning = 30; # % for warning notification

View file

@ -142,9 +142,12 @@ PanelWindow {
}
}
M.BarGroup {
id: _windowTitleGroup
Layout.minimumWidth: 0
clip: true
M.WindowTitle {}
M.WindowTitle {
width: Math.max(0, centerSection.x - _windowTitleGroup.x - 2 * M.Theme.groupPadding - M.Theme.groupSpacing)
}
}
Item {
Layout.fillWidth: true

View file

@ -7,7 +7,7 @@ import "." as M
M.BarSection {
id: root
spacing: M.Theme.moduleSpacing
visible: M.Modules.windowTitle.enable && M.NiriIpc.available && M.NiriIpc.focusedTitle !== ""
visible: M.Modules.windowTitle.enable && M.NiriIpc.focusedTitle !== ""
tooltip: M.NiriIpc.focusedAppId ? M.NiriIpc.focusedAppId + "\n" + M.NiriIpc.focusedTitle : M.NiriIpc.focusedTitle
@ -19,6 +19,7 @@ M.BarSection {
}
IconImage {
id: _icon
visible: root._iconSource !== ""
source: root._iconSource
implicitSize: M.Theme.fontSize + 2
@ -35,5 +36,6 @@ M.BarSection {
color: root.accentColor
elide: Text.ElideRight
anchors.verticalCenter: parent.verticalCenter
width: root.width - (_icon.visible ? _icon.width + root.spacing : 0)
}
}