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

rtv的Python项目详细描述


Reddit终端查看器(RTV)

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

不再维护此项目,请参见here

title image

pypitravis-ciPackaging statuscoverallssay-thanks

目录

演示

title image

您可以使用telnetssh直接在您的终端中试用rtv的lite版本,而无需安装:

  • $ telnet redditbox.us
  • $ ssh redditbox.us

redditbox.us是alex jarmoszuk的独立项目

安装

PYPI包

rtv可在PyPI上使用,并可与pip一起安装:

$ pip install rtv

本地软件包

有关支持的发行版软件包的最新列表,请参见Repology

# macOS
$ brew install rtv

# Arch
$ pacman -S rtv

# Nix
$ nix-env -i rtv

# Debian
$ apt install rtv

# FreeBSD
$ pkg install rtv

来源

$ git clone https://github.com/michael-lazar/rtv.git
$ cd rtv
$ python setup.py install

窗口

由于缺乏资源和兴趣,Windows不支持RTV。对不起的!

用法

要运行程序,请键入:

$ rtv --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/rtv/目录中。

查看rtv.cfg以获取可配置选项的完整列表。您可以通过运行:

$ rtv --copy-config

查看媒体链接

您可以使用mailcap来配置rtv如何打开不同类型的链接。

title image

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

$ rtv --copy-mailcap

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

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

环境变量

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

$RTV_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.
$RTV_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.
$RTV_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.

剪贴板

rtv支持将提交链接复制到os剪贴板。在macos上,这是现成的支持。 在linux系统上,您需要安装xselxclip

主题

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

Solarized Dark

Solarized Light

Papercolor

Molokai

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

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

常见问题解答

<详细信息>为什么在安装/启动rtv时出现错误? ^{B问题1}$ <详细信息>为什么我看到像m-b~@m-“^@这样的混乱文本?

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

  1. Try starting RTV in ascii-only mode with rtv --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 ~/rtv_project.

$ cd ~/rtv_project
$ python3 -m rtv

贡献

欢迎所有反馈和建议,只需发布一个问题!

在编写任何代码之前,请阅读Contributor Guidelines

许可证

此项目是在MIT许可证下分发的。

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

推荐PyPI第三方库


热门话题
java三角测距   java Spring异步任务返回未来   java如何显示数据库中的下一条记录   java这些读取用户输入的方法有什么不同?   java Spring+Spring安全请求只接受contenttype xwwwformurlencoded   checkName()和将用户输入存储到ArrayList和boolean[]的java问题   java如何使用JPA和Facade?   java Neo4j类型不匹配   java如何依赖Maven的系统包?   通过FileChooser保存pdf格式会提示在java中出现第二个对话框   java如何将通量链接到另一个通量/单声道并应用另一个背压?   java如何修复安卓 studio中的权限错误?   尝试清除JavaFX ObservableMap时出现java ConcurrentException   java编辑文本。GetText,返回关于null引用的异常,但已声明该异常   mysql组织。乔达。时间LocalDate在Redhat(Linux)java上显示少一天   在java中通过序列化获取多个对象   有人有java注释“java.lang.Synthetic”的背景吗?