你终端的黑客新闻
pyhn的Python项目详细描述
你的终端上有黑客新闻。
别担心你的IP。pyhn没有攻击性,它使用缓存。
- Cache manager
- Customize all the colors
- Customize all the keybinds
- Default vim-like keybindings
- Compatible with Top, Ask, Show and Job stories
- Auto refresh support
- Play nice with tmux and screen (over ssh too!)
- Open storiers in your commandline web browser
- Mouse support
- Easily installable
- Easily hackable
- Ultra fast
- Python 2 and 3
- MIT license
用法
对所有密钥绑定使用帮助:
- h,?:打印帮助弹出窗口
配置
默认情况下,配置文件位于$HOME/.pyhn/config中。 可以设置键绑定、颜色等。
这是一个示例文件:
[keybindings] open_story_link = S,enter show_story_link = s open_comments_link = C show_comments_link = c open_user_link = U show_user_link = u up = j down = k page_up = ctrl d page_down = ctrl u first_story = g last_story = G refresh = r,R reload_config = ctrl r,ctrl R newest_stories = n top_stories = t best_stories = b show_stories = d show_newest_stories = D ask_stories = a jobs_stories = J [settings] cache = /home/socketubs/.pyhn/cache cache_age = 5 # Refresh interval in minutes (default: 5. minimum: 1) refresh_interval = 5 browser_cmd = __default__ [colors] body = default| focus = white,bold|dark cyan footer = black|light gray footer-error = dark red,bold|light gray header = black,bold|light gray title = dark red,bold|light gray help = black,standout|dark cyan
设置
- cache_age是一个分钟指示器,当缓存过期时,它会告诉CacheManager。
- browser_cmd是一个bash命令,用于打开链接
示例:
browser_cmd = lynx __url__ browser_cmd = __default__ browser_cmd = w3m __url__ browser_cmd = echo "[INFO] Open with w3m: __url__" >> /tmp/pyhn.log && w3m __url__
键绑定
可以使用逗号分隔符为同一操作设置不同的键绑定。 看看urwidinput手册。
颜色
颜色选项的设计如下:foreground|background|monochrome。
前景
- colors:'default'(使用终端的默认前景)、'black'、'暗红色'、'暗绿色'、'brown'、'暗蓝色'、'dark magnta'、'dark cyan'、'light gray'、'light red'、'light green'、'yellow'、'light blue'、'light magnta'、'light cyan',“白色”
- settings:'粗体','下划线','闪烁','突出'
背景
- 颜色:“默认”(使用终端的默认背景)、“黑色”、“深红色”、“深绿色”、“棕色”、“深蓝色”、“深洋红色”、“深青色”、“浅灰色”
单色
- settings:'粗体','下划线','闪烁','突出'
有关更多信息,您可以查看urwidmanual。