Package: tuir
Terminal UI for Reddit (TUIR)A text-based interface (TUI) to view and interact with Reddit from your terminal.TUIR is a fork of rtv, which was maintained by Michael Lazar inthis repositoryuntil Jun 3, 2019.Table of ContentsDemoInstallationUsageSettingsThemesFAQContributingLicenseDemoInstallationPyPI packageTUIR is available onPyPIand can be installed with pip:$pipinstalltuirMigration from RTVIf you are migrating from RTV to TUIR, you can simply rename your old config directory/config file:$mv~/.config/rtv~/.config/tuir
$mv~/.config/tuir/rtv.cfg~/.config/tuir/tuir.cfgPlease take care to use the new API keys for Imgur and Reddit. To replace with sed:$sed-i's/E2oEtRQfdfAfNQ/zjyhNI7tK8ivzQ/; s/93396265f59dec9/b33d69ac8931734/'~/.config/tuir/tuir.cfgDistro packagesSeeRepologyfor an up-to-date list of supported distro packages.ArchTUIR is available from the AUR with the package nameTUIR.From source$gitclonehttps://gitlab.com/ajak/tuir.git
$cdtuir
$pythonsetup.pyinstallWindowsTUIR is not supported on Windows, due to a lack of resources and interest. Sorry!UsageTo run the program, type:$tuir--helpControlsMove the cursor using either the arrow keys orVimstyle movement:Press▲and▼to scroll through submissionsPress▶to view the selected submission and◀to returnPressspace-barto expand/collapse commentsPressuto login (this requires a web browser forOAuth)Press?to open the help screenPress/to open the navigation prompt, where you can type things like:/front/r/commandprompt+linuxmasterrace/r/programming/controversial/u/me/u/multi-mod/m/art/domain/github.comSeeCONTROLSfor the full list of commands.SettingsConfiguration FileConfiguration files are stored in the{HOME}/.config/tuir/directory.Check outtuir.cfgfor the full list of configurable options. You can clone this file into your home directory by running:$tuir--copy-configViewing Media LinksYou can usemailcapto configure how TUIR will open different types of links.A mailcap file allows you to associate different MIME media types, likeimage/jpegorvideo/mp4, with shell commands. This feature is disabled by default because it takes a few extra steps to configure. To get started, copy the default mailcap template to your home directory.$tuir--copy-mailcapThis template contains examples for common MIME types that work with popular reddit websites likeimgur,youtube, andgfycat. Open the mailcap template and follow theinstructionslisted inside.Once you've setup your mailcap file, enable it by launching tuir with thetuir --enable-mediaflag (or set it in yourtuir.cfg)Environment VariablesThe default programs that TUIR interacts with can be configured through environment variables:$TUIR_EDITORA program used to compose text submissions and comments, e.g.vim,emacs,geditIf not specified, will fallback to $VISUAL and $EDITOR in that order.$TUIR_BROWSERA program used to open links to external websites, e.g.firefox,google-chrome,w3m,lynxIf not specified, will fallback to $BROWSER, or your system's default browser.$TUIR_URLVIEWERA tool used to extract hyperlinks from blocks of text, e.g.urlview,urlscanIf not specified, will fallback to urlview if it is installed.ClipboardTUIR supports copying submission links to the OS clipboard.  Data being copied is piped into a command specified by the configuration optionclipboard_cmd. If this option is not set, the command will default topbcopy won Darwin systems (OSX), andxclip -selection clipboardon Linux.ThemesThemes can be used to customize the look and feel of TUIRSolarized DarkSolarized LightPapercolorMolokaiYou can list all installed themes with the--list-themescommand, and select one with--theme. You can save your choice permanently in yourtuir.cfgfile. You can also use theF2&F3keys inside of TUIR to cycle through all available themes.For instructions on writing and installing your own themes, seeTHEMES.md.FAQWhy am I getting an error during installation/when launching tuir?If your distro ships with an older version of python 2.7 or python-requests,
you may experience SSL errors or other package incompatibilities. The
easiest way to fix this is to install tuir using python 3. If you
don't already have pip3, seehttp://stackoverflow.com/a/6587528for setup
instructions. Then do$sudopipuninstalltuir
$sudopip3install-UtuirWhy do I see garbled text likeM-b~@M-"or^@?This type of text usually shows up when python is unable to render
unicode properly.Try starting TUIR in ascii-only mode withtuir --asciiMake sure that the terminal/font that you're using supports unicodeTrysetting the LOCALE to utf-8Your python may have been built against the wrong curses library,
seehereandherefor more informationHow do I run the code directly from the repository?This project is structured to be run as a pythonmodule. This means that
you need to launch it using python's-mflag. See the example below, which
assumes that you have cloned the repository into the directory~/tuir_project.$cd~/tuir_project
$python3-mtuirCurrent development statusTUIR currently depends on Michael Lazar's (maintainer of RTV) fork of PRAW being packaged with the program. Michael's fork is a fork from PRAW version 3.6.1, which iscurrently unsupported. Further, packaged dependencies aren't looked upon fondly by various distribution's packaging guidelines (#11,Gentoo Wiki - Why not bundle dependencies). Due to this, I'm working to update TUIR to a more recent PRAW version which isn't bundled.There is significant API breakage from PRAW 3 to PRAW 6 (thePRAW READMEcalls PRAW 4 a "complete rewrite"). As such, updating TUIR to use a PRAW multiple major versions newer is slow going. I am a relatively inexperienced developer and I have less time than I'd like to devote to software. This work is in branchupdate_unbundle_praw(link), so there may not be super recent commits inmaster, but that doesn't mean I'm neglecting TUIR. Unfortunately, this does mean I am not actively working on feature requests. They are always welcome of course, but it would be far simpler to add features after TUIR is converted to using PRAW 6 instead of adding them now and dealing with their breakage later.Python 2 is alsodeadas of 2020. PRAW 6 doesn't even support Python 2, so Python 2 support in TUIR is also being dropped. Given that PRAW3 is packaged with TUIR as a result of RTV doing the same, there is little sense in removing Python 2 support from the packaged version when there is already an updated version of PRAW available, so I will work to remove Python 2 support alongside my efforts to update TUIR for PRAW 6.ContributingAll feedback and suggestions are welcome, just post an issue!Before writing any code, please read theContributor Guidelines.LicenseThis project is distributed under theMITlicense.