Tilde终端Reddit查看器
ttrv的Python项目详细描述
波浪形终端Reddit Viewer(TTRV)
从原始源代码/开发分支到:RTV
一个基于文本的界面(TUI),用于从终端查看Reddit并与之交互。
在
在
在
目录
演示
在
安装
PyPI包
TTRV可在PyPI上使用,并可与pip一起安装:
$ pip install ttrv
来源
^{pr2}$Windows
TTRV在Windows上不受支持,但您可以启用Windows subsystem for Linux,从Microsoft Store下载首选的Linux发行版并从那里访问它。在
要打开边缘上的链接,请将下面的行粘贴到{HOME}/.bashrc
export BROWSER='/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'
使用
要运行程序,请键入:
$ ttrv --help
控制
使用箭头键或Vim样式移动光标:
- 按▲和▼滚动提交内容
- 按▶以查看所选提交内容和◀返回
- 按空格键展开/折叠注释
- 按u登录(这需要OAuth的web浏览器)
- 按?打开帮助屏幕
按/打开导航提示,您可以在其中键入以下内容:
/front
/r/commandprompt+linuxmasterrace
/r/programming/controversial
/u/me
/u/multi-mod/m/art
/domain/github.com
有关命令的完整列表,请参见CONTROLS。在
设置
配置文件
配置文件存储在{HOME}/.config/ttrv/
目录中。在
查看ttrv.cfg可配置选项的完整列表。您可以通过运行以下命令将此文件克隆到主目录中:
$ ttrv --copy-config
查看媒体链接
您可以使用mailcap来配置TTRV将如何打开不同类型的链接。在
在
mailcap文件允许您将不同的MIME媒体类型(如image/jpeg
或{
$ ttrv --copy-mailcap
此模板包含常见MIME类型的示例,这些MIME类型可用于流行的reddit网站,如imgur、youtube和gfycat。打开mailcap模板并按照其中列出的instructions进行操作。在
一旦设置了mailcap文件,就可以使用ttrv --enable-media
标志启动ttrv(或在^{str 1}中设置它)来启用它$ttrv.cfg公司)
环境变量
TTRV与之交互的默认程序可以通过环境变量进行配置:
$TTRV_EDITOR | A program used to compose text submissions and comments, e.g. vim, emacs, gedit If not specified, will fallback to $VISUAL and $EDITOR in that order. |
$TTRV_BROWSER | A program used to open links to external websites, e.g. firefox, google-chrome, w3m, lynx If not specified, will fallback to $BROWSER, or your system's default browser. |
$TTRV_URLVIEWER | A tool used to extract hyperlinks from blocks of text, e.g. urlview, urlscan If not specified, will fallback to urlview if it is installed. |
剪贴板
TTRV支持将提交链接复制到操作系统剪贴板。在macOS上,这是现成的支持。 在Linux系统上,您需要安装xsel或{a17}。在
主题
主题可用于定制TTRV的外观
^{tb2}$您可以使用--list-themes
命令列出所有已安装的主题,并使用--theme
选择一个主题。您可以将您的选择永久保存在ttrv.cfg文件中。您也可以使用TTRV内部的F2和F3键循环浏览所有可用的主题。在
有关编写和安装您自己的主题的说明,请参见THEMES.md。在
常见问题解答
<详细信息>详细信息><详细信息>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 ttrv using python 3. If you don't already have pip3, see http://stackoverflow.com/a/6587528 for setup instructions. Then do
$ sudo pip uninstall ttrv $ sudo pip3 install -U ttrv
详细信息><详细信息>This type of text usually shows up when python is unable to render unicode properly.
- Try starting TTRV in ascii-only mode with
ttrv --ascii
- Make sure that the terminal/font that you're using supports unicode
- Try setting the LOCALE to utf-8
- Your python may have been built against the wrong curses library, see here and here for more information
详细信息>This project is structured to be run as a python module. This means that you need to launch it using python's
-m
flag. See the example below, which assumes that you have cloned the repository into the directory ~/ttrv_project.$ cd ~/ttrv_project $ python3 -m ttrv
贡献
所有馈线欢迎回复和建议,只需发布一个问题!在
在编写任何代码之前,请阅读Contributor Guidelines。在
许可证
此项目是在MIT许可证下分发的。在
- 项目
标签: