ckampfe / russ

A TUI RSS reader with vim-like controls and a local-first, offline-first focus
GNU Affero General Public License v3.0
160 stars 18 forks source link

[FEATURE] a command to return the number of unread feeds #15

Closed nerd190 closed 1 year ago

nerd190 commented 1 year ago

Is there an existing issue for this?

Feature description

russ is amazing! - thank you!

There are some features that I miss when I was using newsboat, the main one being notifications, newsboat allows running its commands from the shell without entering the ui, for example: newboat -x print-unread returns: 9 unread articles

This means I can have system notifications, or even have something like "✉️ 9" in either my tmux or vim statusline, or even my shell prompt.

THANK YOU AGAIN! 🙏

ckampfe commented 1 year ago

Hi @nerd190 , thank you for opening the issue, this is a great idea I had not considered before.

This type of feature strikes me as the kind of thing that will vary substantially based on user preferences, so I think this type of feature might be better accomplished as a script that runs outside of russ, especially if the goal is to run it in a statusline, system-level notification, etc. As russ is built on a sqlite database, you have the full power of sqlite available to you. Russ' database schema has been stable for some time, and while it may change in the future, I do my absolute best to try to ensure it changes in a backwards-compatible way.

For example, you might start with something like this:

#!/usr/bin/env sh

sqlite3 $YOUR_RUSS_DB_PATH -noheader "select count(*) || ' unread articles' from entries where read_at is null;" 2> /dev/null

Does this make sense? I'm happy to help with the SQL if you have other ideas here.

Thanks!