reddit的简单终端查看器(reddit的终端ui)
tuir的Python项目详细描述
reddit终端用户界面(tuir)
一个基于文本的界面(tui),用于从终端查看reddit并与之交互。
tuir是rtv的分支,由michael lazar在this respository中维护到2019年6月3日。
目录
演示
安装
PYPI包
TUIR在PyPI上可用,可以与pip一起安装:
$ pip install tuir
从rtv迁移
如果要从rtv迁移到tuir,只需重命名旧的配置目录/config文件即可:
$ mv ~/.config/rtv ~/.config/tuir $ mv ~/.config/tuir/rtv.cfg ~/.config/tuir/tuir.cfg
请注意使用imgur和reddit的新api密钥。替换为sed:
$ sed -i 's/E2oEtRQfdfAfNQ/zjyhNI7tK8ivzQ/; s/93396265f59dec9/b33d69ac8931734/' ~/.config/tuir/tuir.cfg
本地软件包
请参阅Repology以获取受支持的发行版包的最新列表。
来源
$ git clone https://gitlab.com/ajak/tuir.git
$ cd tuir
$ python setup.py install
窗口
由于缺乏资源和兴趣,Windows不支持TUIR对不起的!
用法
要运行程序,请键入:
$ tuir --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/tuir/
目录中
查看tuir.cfg以获取可配置选项的完整列表。您可以通过运行:
$ tuir --copy-config
查看媒体链接
您可以使用mailcap来配置tuir如何打开不同类型的链接。
mailcap文件允许您将不同的mime媒体类型(如image/jpeg
或video/mp4
)与shell命令相关联。此功能在默认情况下被禁用,因为它需要一些额外的步骤来配置。要开始,请将默认的mailcap模板复制到主目录。
$ tuir --copy-mailcap
此模板包含与流行的reddit网站(如imgur、youtube和gfycat一起工作的常见mime类型的示例。打开mailcap模板并按照里面列出的instructions操作。
设置完mailcap文件后,使用tuir --enable-media
标志启动tuir(或在tuir.cfg中设置)
环境变量
tuir与之交互的默认程序可以通过环境变量进行配置:
$TUIR_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. |
$TUIR_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. |
$TUIR_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. |
剪贴板
tuir支持将提交链接复制到os剪贴板。在macos上,这是现成的支持。 在Linux系统上,您需要安装xsel或xclip。
主题
主题可以用来定制TUIR的外观和感觉
Solarized Dark | Solarized Light |
Papercolor | Molokai |
您可以使用--list-themes
命令列出所有已安装的主题,并使用--theme
选择一个主题。您可以将您的选择永久保存在tuir.cfg文件中。您还可以使用tuir内的f2&;kbd>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 tuir using python 3. If you don't already have pip3, see http://stackoverflow.com/a/6587528 for setup instructions. Then do
$ sudo pip uninstall tuir $ sudo pip3 install -U tuir
详细信息><详细信息>This type of text usually shows up when python is unable to render unicode properly.
- Try starting TUIR in ascii-only mode with
tuir --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 ~/tuir_project.$ cd ~/tuir_project $ python3 -m tuir
贡献
欢迎所有反馈和建议,只需发布一个问题
在编写任何代码之前,请阅读Contributor Guidelines
许可证
此项目是在MIT许可证下分发的。