feat: refresh mail widget
This commit is contained in:
@@ -33,6 +33,7 @@ dummy = Window(visible=False)
|
|||||||
finder = FuzzyWindowFinder()
|
finder = FuzzyWindowFinder()
|
||||||
|
|
||||||
bar_windows = []
|
bar_windows = []
|
||||||
|
notmuch_widget = None
|
||||||
|
|
||||||
app = Application("bar", dummy, finder)
|
app = Application("bar", dummy, finder)
|
||||||
|
|
||||||
@@ -54,6 +55,7 @@ else:
|
|||||||
|
|
||||||
|
|
||||||
def spawn_bars():
|
def spawn_bars():
|
||||||
|
global notmuch_widget
|
||||||
logger.info("[Bar] Spawning bars after river ready")
|
logger.info("[Bar] Spawning bars after river ready")
|
||||||
outputs = river.outputs
|
outputs = river.outputs
|
||||||
|
|
||||||
@@ -66,6 +68,8 @@ def spawn_bars():
|
|||||||
for i, output_id in enumerate(output_ids):
|
for i, output_id in enumerate(output_ids):
|
||||||
bar = StatusBar(display=output_id, tray=tray if i == 0 else None, monitor=i)
|
bar = StatusBar(display=output_id, tray=tray if i == 0 else None, monitor=i)
|
||||||
bar_windows.append(bar)
|
bar_windows.append(bar)
|
||||||
|
if i == 0 and bar.notmuch:
|
||||||
|
notmuch_widget = bar.notmuch
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,9 @@
|
|||||||
makku = pkgs.writeShellScriptBin "makku" ''
|
makku = pkgs.writeShellScriptBin "makku" ''
|
||||||
dbus-send --session --print-reply --dest=org.Fabric.fabric.bar /org/Fabric/fabric org.Fabric.fabric.Evaluate string:"finder.show()" > /dev/null 2>&1
|
dbus-send --session --print-reply --dest=org.Fabric.fabric.bar /org/Fabric/fabric org.Fabric.fabric.Evaluate string:"finder.show()" > /dev/null 2>&1
|
||||||
'';
|
'';
|
||||||
|
notmuch-refresh = pkgs.writeShellScriptBin "notmuch-refresh" ''
|
||||||
|
dbus-send --session --print-reply --dest=org.Fabric.fabric.bar /org/Fabric/fabric org.Fabric.fabric.Evaluate string:"notmuch_widget.service.update_unread_count() if notmuch_widget else None" > /dev/null 2>&1
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
apps.default = {
|
apps.default = {
|
||||||
type = "app";
|
type = "app";
|
||||||
|
|||||||
Reference in New Issue
Block a user