1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +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 = [
pkgs.newsboat
(pkgs.writers.writeDashBin "newsboat-unread-count" ''
printf "🆕"
if [ -f ${newsboat-home}/cache.db.lock ]; then
echo
${pkgs.jq}/bin/jq -n '{state: "Info", text: "", icon: "update"}'
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
'')
(pkgs.writers.writeDashBin "mpv-watch-later" ''