Tuir

From wikinotes

Commandline reddit client.
Fork of rtv to keep it alive.


WARNING:

rtv is once again being maintained, and tuir is not.
the king is dead, long live the king.

Documentation

gitlab https://gitlab.com/ajak/tuir
hotkeys https://gitlab.com/ajak/tuir/-/blob/master/CONTROLS.md
mailcap docs http://sand.truman.edu/~dbindner/guide/x2059.htm

Locations

~/.config/tuir/tuir.cfg configure tuir
~/.config/tuir/mailcap associate mimetypes to programs
~/.local/share/tuir ephemeral data, like refresh tokens

Install

pacaur -S tuir
tuir --copy-mailcap  # replaces your ~/.config/tuir/.mailcap with defaults
tuir --copy-config   # replace your ~/.config/tuir/tuir.cfg with defaults

Configuration

Environment

tuir respects EDITOR, BROWSER, and URLVIEWER environment variables. If you would prefer to to override these you may.

export TUIR_EDITOR=nvim
export TUIR_BROWSER=w3m
export TUIR_URLVIEWER=urlview

Configuration

OAUTH token creation

From July 2021 - Aug 2021, you needed to create/assign your own OAUTH token.

Create Token


- https://www.reddit.com/prefs/apps/
  - create a new app
    type:          installed app
    redirect uri:  http://127.0.0.1:65000/
  - token will be 3rd line under created token's name


Use Token


- copy token from https://www.reddit.com/prefs/apps/
  (3rd line under app title)
# ~/.config/tuir/tuir.cfg

oauth_client_id = ${YOUR_TOKEN}
oauth_client_secret =
oauth_redirect_uri = http://127.0.0.1:65000/


Login


- tuir
  - press 'u' to login


vi hotkeys

todo: vi hotkeys

#SUBMISSION_OPEN_IN_BROWSER = o, <LF>, <KEY_ENTER>  # 
#SUBREDDIT_OPEN_IN_BROWSER = o, <LF>, <KEY_ENTER>

PROMPT = /            # --> f
SUBREDDIT_SEARCH = f  # --> /

logging

Logging is disabled by default, but enable it

# ~/.config/tuir/tuir.cfg

[tuir]
log = /var/tmp/tuir.log

Usage

/front   # reddit frontpage
/u/me    # your posts
/ghibli  # go to /r/ghibli
# =====
# setup
# =====
u      # login

# ==========
# navigation
# ==========
f      # search selected reddit (or all reddit if on frontpage)
p      # toggle subreddit/frontpage

s      # list subscribed subreddits
i      # view inbox
/      # type subreddit name (ex: '/archlinux')

# =========
# post list
# =========
j/k    # up/down
h      # back to list
l      # view comments
enter  # open

c      # comment
C      # private message

# ========
# settings
# ========
F2/F3  # cycle themes

Themes

rtv --list-themes
rtv --theme colorblind-dark