1
0
mirror of https://github.com/kmein/niveum synced 2026-03-18 11:01:07 +01:00

feat(i3status-rust): newsboat via json

This commit is contained in:
2022-08-19 11:26:56 +02:00
parent 38946d1c20
commit 5fa7957978
2 changed files with 8 additions and 4 deletions

View File

@@ -76,11 +76,14 @@ in {
environment.systemPackages = [ environment.systemPackages = [
pkgs.newsboat pkgs.newsboat
(pkgs.writers.writeDashBin "newsboat-unread-count" '' (pkgs.writers.writeDashBin "newsboat-unread-count" ''
printf "🆕"
if [ -f ${newsboat-home}/cache.db.lock ]; then if [ -f ${newsboat-home}/cache.db.lock ]; then
echo ${pkgs.jq}/bin/jq -n '{state: "Info", text: "", icon: "update"}'
else else
${pkgs.sqlite}/bin/sqlite3 ${newsboat-home}/cache.db "SELECT COUNT(DISTINCT id) FROM rss_item WHERE unread=1" ${pkgs.sqlite}/bin/sqlite3 ${newsboat-home}/cache.db "SELECT COUNT(DISTINCT id) FROM rss_item WHERE unread=1" | ${pkgs.jq}/bin/jq '{
state: (if . > 0 then "Good" else "Idle" end),
text: . | tostring,
icon: "update"
}'
fi fi
'') '')
(pkgs.writers.writeDashBin "mpv-watch-later" '' (pkgs.writers.writeDashBin "mpv-watch-later" ''

View File

@@ -72,6 +72,7 @@ in {
time = "📅 "; time = "📅 ";
toggle_off = "👎"; toggle_off = "👎";
toggle_on = "👍"; toggle_on = "👍";
update = "🆕";
volume_empty = "🔈 "; volume_empty = "🔈 ";
volume_full = "🔊 "; volume_full = "🔊 ";
volume_half = "🔉 "; volume_half = "🔉 ";
@@ -87,7 +88,7 @@ in {
block = [ block = [
{ {
block = "custom"; block = "custom";
interval = 5; interval = 10;
command = "newsboat-unread-count"; command = "newsboat-unread-count";
} }
{ {