From f9cfede0d07a270dd99bd7a0cb20f542834045e7 Mon Sep 17 00:00:00 2001 From: Diego Pereyra Date: Mon, 8 Aug 2022 23:09:20 -0300 Subject: [PATCH] Added support for regolith fork of rofication (differs on the comm protocol: \n after command, receive values on csv) --- bumblebee_status/modules/contrib/rofication.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/bumblebee_status/modules/contrib/rofication.py b/bumblebee_status/modules/contrib/rofication.py index 79e6afd..1fd5355 100644 --- a/bumblebee_status/modules/contrib/rofication.py +++ b/bumblebee_status/modules/contrib/rofication.py @@ -5,6 +5,10 @@ module will have normal highlighting if there are zero notifications, "warning" highlighting if there are nonzero notifications, "critical" highlighting if there are any critical notifications + + Parameters: + * rofication.regolith: Switch to regolith fork of rofication, see . + """ import core.module @@ -20,6 +24,7 @@ class Module(core.module.Module): super().__init__(config, theme, core.widget.Widget(self.full_text)) self.__critical = False self.__numnotifications = 0 + self.__regolith = self.parameter("regolith", False) def full_text(self, widgets): @@ -27,10 +32,16 @@ class Module(core.module.Module): client.connect("/tmp/rofi_notification_daemon") # below code will fetch two numbers in a list, e.g. ['22', '1'] # first is total number of notifications, second is number of critical notifications - client.sendall(bytes("num", "utf-8")) + if self.__regolith: + client.sendall(bytes("num\n", "utf-8")) + else: + client.sendall(bytes("num", "utf-8")) val = client.recv(512) val = val.decode("utf-8") - l = val.split('\n',2) + if self.__regolith: + l = val.split(',',2) + else: + l = val.split('\n',2) self.__numnotifications = int(l[0]) self.__critical = bool(int(l[1])) return self.__numnotifications