Newsraft

提供: ArchWiki
2023年9月27日 (水) 19:51時点におけるKusanaginoturugi (トーク | 投稿記録)による版 (英語版より新規作成)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
ナビゲーションに移動 検索に移動

Newsraft is a ncurses feed reader inspired by Newsboat while seeking to be its lightweight alternative. It supports RSS 2.0 and lower, Atom 1.0, RSS Content Module, Media RSS, DublinCore 1.1 Elements, and JSON Feed.

Installation

Install the newsraftAUR package.

Configuration

Configuration of newsraft is optional, used only to change default settings or add functionality. This is accomplished via entries in ~/.config/newsraft/config, including reader and color settings, and key bindings for both built in actions bind key action and shell commands bind key exec command, including options for opening links in designated programs. Multiple commands can be associated with a single binding by separating them with semicolons:

~/.config/newsraft/config
bind f exec feh "%l"
bind key action1; exec command1; action2; exec command2

Default key bindings can be disabled if undesired or for repurposing with unbind key. Finally, like the feeds file, the # symbol designates comment lines and will be ignored by newsraft.

Example configuration

~/.config/newsraft/config
# Colors
set color-list-item-fg red
set color-list-item-unread-fg white

# Settings
set send-user-agent-header false

# Key bindings
bind d mark-read
unbind D
bind m exec mpv "%l"

A full listing of available actions, settings, and defaults is available in newsraft(1).

Usage

Newsraft needs a feeds file created before it can be launched. The default feed file location and name is ~/.config/newsraft/feeds. Once this is populated with links to feeds, start newsraft with the command:

$ newsraft

Managing feeds

The feeds file can contain three types of lines. The first is the feed URL, which can be added with a text editor one feed per line:

~/.config/newsraft/feeds
https://example.org/feed.xml "Lorem Ipsum Blog"

Only the URL is strictly necessary. Newsraft will attempt to name the feed based on information provided by the feed. If an alternate name is desired, this can be supplied by adding the title in enclosed double quotes separated from the URL by at least one white space.

Section headers are the next type of line, which start with the @ symbol, at least one white space, and then the section name:

~/.config/newsraft/feeds
@ Section Header

The final type of entry in the feeds file are comments, which start with the # symbol:

~/.config/newsraft/feeds
# this line is completely ignored by newsraft

Both feed URLs and section headers can set auto update frequency, with individual feed frequencies overriding sectional frequencies. The period is specified by a number minutes enclosed by curly brackets:

~/.config/newsraft/feeds
@ Section Header {120}
https://example.org/feed2.xml "Lorem Ipsum Blog" {60}
https://example.org/feed3.xml
https://example.org/feed4.xml {0}

Specifying {0} will disable automatic updates and global feed updates can be specified by using the Global section header. In the above example, all feeds under Section Header are automatically updated every two hours, except feed2, which is updated every hour, and feed4, which is never automatically updated.

Basic default commands

While all of these key bindings can be modified via newsraft's config file, here are the basic default key bindings and their commands:

Command Description
j - select-next move selection down to next menu item
k - select-prev move selection up to previous menu item
l - enter open selected menu item
h - quit close selected menu item, return to previous menu. If currently in top menu, quit newsraft
d - mark-read; jump-to-next mark selection read and move to next menu item
D - mark-unread; jump-to-next mark selection unread and move to next menu item
^D - mark-read-all mark all menu items read
o - open-in-browser open selection in browser. If no number precedes 'o', opens first selection
r - reload manually update selected feed
^R - reload-all manually update all feeds