fix: instantly spawn bar

This commit is contained in:
2026-05-04 00:00:11 +02:00
parent 0cd58f4a1f
commit 6343c91fca
5 changed files with 14 additions and 12 deletions

View File

@@ -22,6 +22,7 @@ pkgs.mkShell {
gobject-introspection gobject-introspection
libdbusmenu-gtk3 libdbusmenu-gtk3
gdk-pixbuf gdk-pixbuf
librsvg
gnome-bluetooth gnome-bluetooth
cinnamon-desktop cinnamon-desktop
wayland-scanner wayland-scanner
@@ -46,4 +47,8 @@ pkgs.mkShell {
] ]
)) ))
]; ];
shellHook = ''
export GDK_PIXBUF_MODULE_FILE=${pkgs.librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
'';
} }

View File

@@ -31,7 +31,7 @@ from .services.screenrec import ScreenrecService
tray = SystemTray(name="system-tray", spacing=4) tray = SystemTray(name="system-tray", spacing=4)
i3 = get_i3_connection() get_i3_connection()
dummy = Window(visible=False) dummy = Window(visible=False)
finder = FuzzyWindowFinder() finder = FuzzyWindowFinder()
@@ -147,15 +147,9 @@ def spawn_bars():
if i == 0 and bar.notmuch: if i == 0 and bar.notmuch:
notmuch_widget = bar.notmuch notmuch_widget = bar.notmuch
return False
def main(): def main():
if i3.ready:
spawn_bars() spawn_bars()
else:
i3.connect("notify::ready", lambda *_: spawn_bars())
app.run() app.run()

View File

@@ -32,7 +32,9 @@ class Battery(Box):
level = max(10, min(100, round(bat / 10) * 10)) level = max(10, min(100, round(bat / 10) * 10))
if charging: if charging:
return f"battery-level-{level}-charging-symbolic" # Adwaita ships battery-level-100-charged-symbolic, not -charging.
suffix = "charged" if level == 100 else "charging"
return f"battery-level-{level}-{suffix}-symbolic"
else: else:
return f"battery-level-{level}-symbolic" return f"battery-level-{level}-symbolic"

View File

@@ -167,12 +167,12 @@ class NotmuchWidget(Button):
if count > 0: if count > 0:
self.label.set_text(str(count)) self.label.set_text(str(count))
self.label.set_visible(True) self.label.set_visible(True)
self.icon.set_from_icon_name("mail-unread-symbolic", 16) self.icon.set_property("icon-name", "mail-unread-symbolic")
self.set_style_classes(["notmuch-widget", "has-unread"]) self.set_style_classes(["notmuch-widget", "has-unread"])
else: else:
self.label.set_text("") self.label.set_text("")
self.label.set_visible(False) self.label.set_visible(False)
self.icon.set_from_icon_name("mail-read-symbolic", 16) self.icon.set_property("icon-name", "mail-read-symbolic")
self.set_style_classes(["notmuch-widget", "no-unread"]) self.set_style_classes(["notmuch-widget", "no-unread"])
logger.info(f"[Notmuch] Updated display: {count} unread emails") logger.info(f"[Notmuch] Updated display: {count} unread emails")

View File

@@ -111,7 +111,8 @@ class FensterWorkspaces(Box):
) )
if self._i3.ready: if self._i3.ready:
self._schedule_refresh() # Initial state is already current — no need to defer.
self._refresh_workspaces()
else: else:
self._i3.connect("notify::ready", lambda *_: self._schedule_refresh()) self._i3.connect("notify::ready", lambda *_: self._schedule_refresh())