Gabriel CachadiΓ±a

Newsboat customization

Β· Gabriel CachadiΓ±a

Newsboat is a minimalist terminal utility that can be customized to use the same key mappings as VIM, allowing for fast reading of feeds from:

Theme

A while ago, I found a customization that I consider my favorite in the program, which allows me to have a different color palette based on the source of the RSS feed, as well as showing the title, author, date, etc., in different colors. This customization is within .config/newsboat/config.

# -- Theme ----------------------------------------------------------------
color listnormal default default
color listfocus default default reverse
color listnormal_unread default default bold
color listfocus_unread default default bold underline
color info red black bold
color article default default

highlight article "^Feed:.*" magenta default
highlight article "^Title:.*" yellow default bold
highlight article "^Author:.*" green default
highlight article "^Date:.*" color223 default
highlight article "^Link:.*" blue default
highlight article "^Flags:.*" color9 default
highlight article "\\[[0-9][0-9]*\\]" color66 default bold
highlight article "\\[image [0-9][0-9]*\\]" color109 default bold
highlight article "\\[embedded flash: [0-9][0-9]*\\]" color66 default bold

#highlight feedlist "[β•’β•˜β•ž]═.*═[β•›β••β•‘]" yellow default bold
highlight feedlist "[β•‘β”‚]" yellow default bold
highlight feedlist "╠═.*" yellow default bold

highlight feedlist "\\(Youtube\\) .*" red
highlight feedlist "\\(Twitter\\) .*" blue
highlight feedlist "\\(Reddit\\) .*" green
highlight feedlist "\\(Podcast\\) .*" yellow
highlight feedlist "\\(Twitch\\) .*" magenta
highlight feedlist "\\(Blog\\) .*" cyan
#highlight feedlist "\\(Reddit\\) .*" color166


feedlist-format "%?T?β•‘%4i %n %8u (%T) %t &╠═════════════════════════════════════════════════════%t?"
#feedlist-format "%?T?β•‘%4i %n %8u (%T) %t &β• %=═0%t?"
#feedlist-format "%?T?β•‘%4i %n %8u (%T) %t &%==11first%=x16SECOND%=~13third?"

Navigation

By default, you can use the arrow keys to navigate in Newsboat, but I prefer using the VIM keybindings in any program I use, so I use the following configuration, which is also found in .config/newsboat/config:

# -- navigation ----------------------------------------------------------------
# unbind keys
unbind-key ENTER
unbind-key j
unbind-key k
unbind-key J
unbind-key K
unbind-key l

# bind keys - vim style
bind-key j down
bind-key k up
bind-key l open
bind-key h quit

Miscellaneous

For some of the feeds, I like to view the original page where they come from or open a video in the case of Twitch or YouTube. For this purpose, I use Librewolf and MPV in a Newsboat shortcut for these actions within .config/newsboat/config (note that the macro key in my case is ,):

# -- misc ----------------------------------------------------------------------
macro w set browser "librewolf %u"; open-in-browser ; set browser "librewolf %u"
macro v set browser "setsid -f mpv --really-quiet --no-terminal" ; open-in-browser ; set browser librewolf

Feeds

For Newsboat to load the feeds, they must be saved in .config/newsboat/urls with the following structure:

Blogs
http://lukesmith.xyz/rss.xml Blog "~Luke Smith" Tech
Youtube
https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA Youtube "~Luke Smith" Tech
https://www.youtube.com/feeds/videos.xml?channel_id=UC7YOGHUfC1Tb6E4pudI9STA Youtube "~Mental Outlaw"
Twitch
https://twitchrss.com/feeds/?username=riotgames&feed=streams Twitch "~RiotGames"
Podcast
Reddit

Where all lines should contain the link, the topic they belong to, the name of the feed, and the subcategory.

#gnu/linux

Reply to this post by email β†ͺ