Hi folks I am here with another interesting topic called RTV (Reddit Terminal Viewer) – A Simple Terminal Viewer For Reddit. It’s built in python using the curses library.
When it come to CLI utility, I’m very much interested to dig more on that since I prefer CLI (Command Line Interface) most of the time instead of GUI. Not only me, many of NIX guys are there in the same mentality.
RTV stands for Reddit Terminal Viewer which provides an interface to view and interact with reddit from your terminal. It’s compatible with most terminal emulators on Linux and OS X.
Reddit is a social news aggregation, web content rating, and discussion website. Most of the nix website has their own page in reddit, registered users are allowed to submit text posts or direct links, also they can vote submissions up or down. Most up votes page appear on the front page or the top of a category.
How to install RTV in Linux
RTV package is there in Debian based distributions & Fedora official repository, also it available in AUR repository for Arch based distributions. However, others can easily install since it was there in Python repository.
Since distributions official repository offers bit older version, so I prefer to go with pip based installation.
pip is a python module bundled with setuptools, it’s one of the recommended tool for installing Python packages in Linux.
For Debian/Ubuntu
, use APT-GET Command or APT Command to install pip.
$ sudo apt install python-pip
For RHEL/CentOS
, use YUM Command to install pip.
$ sudo yum install python-pip python-devel
For Fedora
, use DNF Command to install pip.
$ sudo dnf install python-pip
For Arch Linux
, use Pacman Command to install pip.
$ sudo pacman -S python-pip
For openSUSE
, use Zypper Command to install pip.
$ sudo pacman -S python-pip
Finally, Run the following pip command to install RTV.
$ sudo pip install rtv
How to use RTV
Once the RTV package installed, just fire the rtv
command alone in terminal to load reddit page. When you launch you will get similar to below screen shot.
Control Keys : Note down the control keys which is playing major roles in CLI for any applications.
UP & DOWN Arrow
To move top to bottom submissionsRight Arrow
To view the selected submissionLeft Arrow
To retrun backSpace Bar
To expand/collapse commentsU
To login your account?
To open the help screen/
To open the navigation prompt, where you can type specific things
To Search any particular page, run rtv then fine /
followed by your search. For testing purpose, we are going to search our own page by searching this term /domain/2daygeek.com
.
Press Right Arrow
key to view the selected submission. In our case, we opened first submission.
Press Space Bar
expand/collapse comments.
By default there is no config file for rtv. To generate a new rtv config file run the following command, which place Configuration files to $HOME/.config/rtv/rtv.conf
directory.
$ rtv --copy-config
By default it won’t popup any MIME media types like links or image/jpeg or video/mp4, this can be achieved by generating a mailcap file. Also it’s required some additional configuration. Open the mailcap template and follow the instructions listed inside.
Run the following command to generate a new mailcap config file, which placed Configuration files to $HOME/.mailcap
.
$ rtv --copy-mailcap
Once you’ve modified your mailcap file, run the following command to enable it. Now, I am able to play videos from rtv.
$ rtv --enable-media
To open any particular page on start, add -s
option followed by the page url. In our case, we are going to open our page url.
$ rtv -s /domain/2daygeek.com
To Login reddit press u
button and follow the instruction, it will ask you to allow cookie for CLI. Once you accept cookie then you will be redirected to login page. Enter login details and hit login button.
For GUI systems, it’s redirecting to reddit login page on default web browser.