ckampfe / russ

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

[Feature] Ability to run without arguments #5

Closed NickLarsenNZ closed 2 years ago

NickLarsenNZ commented 2 years ago

I think having a default database would be a good UX improvement.

On my first time running russ, I expected to be able to get straight into it, but I am instead left with deciding where to put the database, and having to remember where the database is everytime I want to use it. This adds friction and would make me lose interest rather quickly.

Could the --database-path option become optional, with a default of say $XDG_CONFIG_HOME/russ/database.sqlite (eg: $HOME/.config/russ/database.sqlite)?

See: XDG Base Directory spec

ckampfe commented 2 years ago

@NickLarsenNZ Yeah this is not a bad idea. I'll have to think about it some but I'm not opposed. I'd also welcome a PR if that's something you're interested in.

NickLarsenNZ commented 2 years ago

I'd be happy to raise a PR. I took a quick look at how Alacritty looks for a config, and thought we can do it in a similar way.

  1. $XDG_CONFIG_HOME/russ/russ.sqlite
  2. $XDG_CONFIG_HOME/russ.sqlite
  3. $HOME/.config/russ/russ.sqlite
  4. $HOME/.russ.sqlite
ckampfe commented 2 years ago

I'd be happy to raise a PR. I took a quick look at how Alacritty looks for a config, and thought we can do it in a similar way.

$XDG_CONFIG_HOME/russ/russ.sqlite $XDG_CONFIG_HOME/russ.sqlite $HOME/.config/russ/russ.sqlite $HOME/.russ.sqlite

Sounds good, let me know how I can help @NickLarsenNZ.

To add a bit more context: Russ' database currently only contains application state, and does not (yet?) contain any data that I consider to be "configuration". For example, the database is not intended to be edited by end users to control the Russ application itself (though it being a Sqlite database, this is certainly possible if one knows SQL).

XDG seems to have some notion of $XDG_STATE_HOME, but I don't know XDG well enough to know what necessarily makes sense here. In any case, changing the actual locations shouldn't be that difficult.

NickLarsenNZ commented 2 years ago

Oh yeah, I had used config in error. XDG defines data and cache too. I was using data in my local version, but stopped when I had to think about first run (initial creation).

ckampfe commented 2 years ago

Fixed by faf7dbe0c29f106db0ee84ee760115c443f5d3c4.