reddit的简单终端查看器(reddit的终端ui)

tuir的Python项目详细描述


reddit终端用户界面(tuir)

一个基于文本的界面(tui),用于从终端查看reddit并与之交互。

tuir是rtv的分支,由michael lazar在this respository中维护到2019年6月3日。

title image

pypigitlab-cicoveragePackaging status

目录

演示

title image

安装

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如何打开不同类型的链接。

title image

mailcap文件允许您将不同的mime媒体类型(如image/jpegvideo/mp4)与shell命令相关联。此功能在默认情况下被禁用,因为它需要一些额外的步骤来配置。要开始,请将默认的mailcap模板复制到主目录。

$ tuir --copy-mailcap

此模板包含与流行的reddit网站(如imguryoutubegfycat一起工作的常见mime类型的示例。打开mailcap模板并按照里面列出的instructions操作。

设置完mailcap文件后,使用tuir --enable-media标志启动tuir(或在tuir.cfg中设置)

环境变量

tuir与之交互的默认程序可以通过环境变量进行配置:

$TUIR_EDITORA 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_BROWSERA 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_URLVIEWERA 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系统上,您需要安装xselxclip

主题

主题可以用来定制TUIR的外观和感觉

Solarized Dark

Solarized Light

Papercolor

Molokai

您可以使用--list-themes命令列出所有已安装的主题,并使用--theme选择一个主题。您可以将您的选择永久保存在tuir.cfg文件中。您还可以使用tuir内的f2&;kbd>f3键循环浏览所有可用的主题。

有关编写和安装自己的主题的说明,请参见THEMES.md

常见问题解答

<详细信息>为什么在安装/启动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, see http://stackoverflow.com/a/6587528 for setup instructions. Then do

$ sudo pip uninstall tuir
$ sudo pip3 install -U tuir
<详细信息>为什么我看到像m-b~@m-“^@这样的混乱文本?

This type of text usually shows up when python is unable to render unicode properly.

  1. Try starting TUIR in ascii-only mode with tuir --ascii
  2. Make sure that the terminal/font that you're using supports unicode
  3. Try setting the LOCALE to utf-8
  4. 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许可证下分发的。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java为什么我们不能将ArrayList<Integer>传递给具有(Integer…)的方法参数   java Spring RestTemplate映射JSON对映射的响应引发不匹配的PutException   在系统中找到java Selenium元素,但在Jenkins中未找到   java在Android中使用JavaMail API发送电子邮件,而不使用默认/内置应用程序   数组如何在Java数据结构中同时存储数字和相应的单词?   为什么“+”运算符未定义?JAVA   java如何在游戏中添加高分系统?   java在球门碰撞中区分球和球员   java如何使用SpringSecurity4.0.1使用Auth令牌实现Rest完整Web服务。释放   java如何解决这个错误:Android资源链接失败?   java多线程文件处理和数据库批插入   导致Tomcat失败的java无用块线程   java主线程做了太多的工作,尽管我使用了异步线程(laggy UI)   在Java FX 2.0中滚动锚定节点时,锚定始终可见?   java使用EJB3中的客户机jar和设计模式