Compare commits

...

2 commits

Author SHA1 Message Date
3e58cde2fe refactor: move to uv
instead of poetry
2026-04-08 08:29:12 +02:00
ddfe1c6eb6 feat(box): color based on the hash of the app
Instead of based on the urgency.
2025-03-13 16:30:25 +01:00
3 changed files with 34 additions and 11 deletions

View file

@ -20,6 +20,8 @@ The CLI bard relies on your terminal using a font patched with the "Powerline"
characters. The recommended fonts are the ones from the characters. The recommended fonts are the ones from the
[Nerd font project](https://www.nerdfonts.com/). [Nerd font project](https://www.nerdfonts.com/).
You may also need to install the `libgirepository-2.0-dev` on your system.
Usage Usage
===== =====

View file

@ -1,15 +1,30 @@
[tool.poetry] [project]
name = "clibard" name = "clibard"
version = "0.1.0" version = "0.1.0"
description = "See all your notifications in the terminal" description = "See all your notifications in the terminal"
authors = ["nojhan <nojhan@nojhan.net>"] authors = [
{ name = "nojhan", email = "nojhan@nojhan.net" },
]
readme = "README.md" readme = "README.md"
[tool.poetry.dependencies] requires-python = ">3.11"
python = "^3.11" dependencies = [
faker = "^0.7.4" "faker>=0.7.4",
humanize = "^4.11" "humanize>=4.11",
rich = "^13.9" "rich>=13.9",
dbus-python = "^1.3" "dbus-python>=1.3",
PyGObject = "^3.50" # You may need to install the system package for libgirepository1.0-dev "PyGObject>=3.50", # You may need to install the system package for libgirepository-2.0-dev
]
[project.scripts]
clibard = "clibard.clibard:main"
[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
where = ["src"]
include = ["clibard"]

View file

@ -272,13 +272,15 @@ class MessageBox(Message):
title = f"{self.icons[self.urgency]} {summ} {self.app}" title = f"{self.icons[self.urgency]} {summ} {self.app}"
# title = f"[{summ_color}]{self.summary}[/]─ {self.app}" # title = f"[{summ_color}]{self.summary}[/]─ {self.app}"
bs = self.hash_color(self.app)
box = rich.panel.Panel( box = rich.panel.Panel(
f"[{body_color}]{self.body}[/]", f"[{body_color}]{self.body}[/]",
title=title, title=title,
title_align="left", title_align="left",
# subtitle = self.icons[self.urgency], # subtitle = self.icons[self.urgency],
# subtitle_align = "left", # subtitle_align = "left",
border_style=f"color({self.color[self.urgency]})", border_style=f"color({bs})",
safe_box = False, safe_box = False,
) )
console.print(box) console.print(box)
@ -412,7 +414,7 @@ def test_messages(nb = 7):
return notifs return notifs
if __name__ == "__main__": def main():
import sys import sys
import argparse import argparse
@ -455,3 +457,7 @@ if __name__ == "__main__":
elif asked.layout[0] == "v": elif asked.layout[0] == "v":
broker = VerticalBroker(msg_cls=MessageBox) broker = VerticalBroker(msg_cls=MessageBox)
broker.run() broker.run()
if __name__ == "__main__":
main()