sfeed

simple feed reader - forked from git.codemadness.org/sfeed
git clone git://src.gearsix.net/sfeed
Log | Files | Refs | Atom | README | LICENSE

sfeed_curses.1 (10528B)


      1 .Dd December 20, 2022
      2 .Dt SFEED_CURSES 1
      3 .Os
      4 .Sh NAME
      5 .Nm sfeed_curses
      6 .Nd curses UI for viewing feed data
      7 .Sh SYNOPSIS
      8 .Nm
      9 .Op Ar
     10 .Sh DESCRIPTION
     11 .Nm
     12 formats feed data (TSV) from
     13 .Xr sfeed 1
     14 from stdin or for each
     15 .Ar file
     16 into a curses UI.
     17 If one or more
     18 .Ar file
     19 arguments are specified then the basename of the
     20 .Ar file
     21 is used as the feed name in the output such as the feeds sidebar.
     22 The
     23 .Ar file
     24 arguments are processed and shown in the specified argument order in the feeds
     25 sidebar.
     26 If no
     27 .Ar file
     28 arguments are specified then the data is read from stdin and the feed name is
     29 "stdin" and no sidebar is visible by default in this case.
     30 .Pp
     31 Items with a timestamp from the last day compared to the system time at the
     32 time of loading the feed are marked as new and bold.
     33 There is also an alternative mode available to mark items as read by matching
     34 it against a list of URLs from a plain-text file.
     35 Items with an enclosure are marked with a @ symbol.
     36 .Pp
     37 .Nm
     38 aligns the output.
     39 Make sure the environment variable
     40 .Ev LC_CTYPE
     41 is set to a UTF-8 locale, so it can determine the proper column-width
     42 per rune, using
     43 .Xr mbtowc 3
     44 and
     45 .Xr wcwidth 3 .
     46 .Sh KEYBINDS
     47 .Bl -tag -width Ds
     48 .It k, ARROW UP
     49 Go one row up.
     50 .It j, ARROW DOWN
     51 Go one row down.
     52 .It K
     53 Go to the previous bold row.
     54 .It J
     55 Go to the next bold row.
     56 .It h, ARROW LEFT
     57 Focus feeds pane.
     58 .It l, ARROW RIGHT
     59 Focus items pane.
     60 .It TAB
     61 Cycle focused pane (between feeds and items).
     62 .It g
     63 Go to the first row.
     64 .It G
     65 Go to the last row.
     66 .It PAGE UP, CTRL-B
     67 Scroll one page up.
     68 .It PAGE DOWN, CTRL-F, SPACE
     69 Scroll one page down.
     70 .It /
     71 Prompt for a new search and search forward (case-insensitive).
     72 .It ?
     73 Prompt for a new search and search backward (case-insensitive).
     74 .It n
     75 Search forward with the previously set search term.
     76 .It N
     77 Search backward with the previously set search term.
     78 .It \&[
     79 Go to the previous feed in the feeds pane and open it.
     80 .It ]
     81 Go to the next feed in the feeds pane and open it.
     82 .It CTRL-L
     83 Redraw screen.
     84 .It R
     85 Reload all feed files which were specified as arguments on startup.
     86 If
     87 .Ev SFEED_URL_FILE
     88 is set, it will reload the URLs from this file also.
     89 .It m
     90 Toggle mouse-mode.
     91 It supports xterm X10 and extended SGR encoding.
     92 .It s
     93 Toggle between monocle layout and the previous non-monocle layout.
     94 .It <
     95 Use a fixed sidebar size for the current layout and decrease the fixed width or
     96 height by 1 column.
     97 .It >
     98 Use a fixed sidebar size for the current layout and increase the fixed width or
     99 height by 1 column.
    100 .It =
    101 Reset the sidebar size to automatically adjust for the current layout.
    102 With the vertical layout the width is the longest feed name with the item
    103 counts right-aligned.
    104 With the horizontal layout the height is half of the window height (minus the
    105 status bar) or otherwise the total amount of visible feeds, whichever fits the
    106 best.
    107 .It t
    108 Toggle showing only feeds with new items in the sidebar.
    109 .It a, e, @
    110 Plumb URL of the enclosure.
    111 The URL is passed as a parameter to the program specified in
    112 .Ev SFEED_PLUMBER .
    113 .It o, ENTER, RETURN
    114 Feeds pane: load feed and its items.
    115 In the monocle layout it will also switch to the items pane after loading the
    116 feed items.
    117 Items pane: plumb current item URL, the URL is passed as a parameter to
    118 the program specified in
    119 .Ev SFEED_PLUMBER .
    120 .It c, p, |
    121 Pipe the whole TAB-Separated Value line to a program.
    122 This program can be specified with
    123 .Ev SFEED_PIPER .
    124 .It y
    125 Pipe the TAB-Separated Value field for yanking the URL to a program.
    126 This program can be specified with
    127 .Ev SFEED_YANKER .
    128 .It E
    129 Pipe the TAB-Separated Value field for yanking the enclosure to a program.
    130 This program can be specified with
    131 .Ev SFEED_YANKER .
    132 .It r
    133 Mark item as read.
    134 This will only work when
    135 .Ev SFEED_URL_FILE
    136 is set.
    137 .It u
    138 Mark item as unread.
    139 This will only work when
    140 .Ev SFEED_URL_FILE
    141 is set.
    142 .It f
    143 Mark all items of the current loaded feed as read.
    144 This will only work when
    145 .Ev SFEED_URL_FILE
    146 is set.
    147 .It F
    148 Mark all items of the current loaded feed as unread.
    149 This will only work when
    150 .Ev SFEED_URL_FILE
    151 is set.
    152 .It 1
    153 Set the current layout to a vertical mode.
    154 Showing a feeds sidebar to the left and the feed items to the right.
    155 .It 2
    156 Set the current layout to a horizontal mode.
    157 Showing a feeds sidebar on the top and the feed items on the bottom.
    158 .It 3
    159 Set the current layout to a monocle mode.
    160 Showing either a feeds or a feed items pane.
    161 .It q, EOF
    162 Quit
    163 .El
    164 .Sh MOUSE ACTIONS
    165 When mouse-mode is enabled the below actions are available.
    166 .Bl -tag -width Ds
    167 .It LEFT-CLICK
    168 Feeds pane: select and load the feed and its items.
    169 In the monocle layout it will also switch to the items pane after loading the
    170 feed items.
    171 Items pane: select item, when already selected then plumb it.
    172 .It RIGHT-CLICK
    173 Feeds pane: select feed, but do not load it.
    174 Items pane: pipe the item.
    175 .It SCROLL UP
    176 Scroll one page up.
    177 .It SCROLL DOWN
    178 Scroll one page down.
    179 .It FORWARD
    180 Switch to the items pane.
    181 .It BACKWARD
    182 Switch to the feeds pane.
    183 .El
    184 .Sh SIGNALS
    185 .Bl -tag -width Ds
    186 .It SIGHUP
    187 Reload all feed files which were specified as arguments on startup.
    188 If
    189 .Ev SFEED_URL_FILE
    190 is set, it will reload the URLs from this file also.
    191 Cancels the line editor and handles the signal if received during a search.
    192 .It SIGINT
    193 Interrupt: quit.
    194 When searching, it only cancels the line editor and doesn't quit.
    195 .It SIGTERM
    196 Quit
    197 .It SIGWINCH
    198 Resize the pane dimensions relative to the terminal size.
    199 When searching, it handles the signal after closing the line editor.
    200 .El
    201 .Pp
    202 Signals are handled in the following order: SIGCHLD, SIGTERM, SIGINT, SIGHUP,
    203 SIGWINCH.
    204 .Sh ENVIRONMENT VARIABLES
    205 .Bl -tag -width Ds
    206 .It Ev SFEED_AUTOCMD
    207 Read and process a sequence of keys as input commands from this environment
    208 variable first, afterwards it reads from the tty as usual.
    209 This can be useful to automate certain actions at the start.
    210 .It Ev SFEED_PIPER
    211 A program where the whole TAB-Separated Value line is piped to.
    212 By default this is "sfeed_content".
    213 .It Ev SFEED_PIPER_INTERACTIVE
    214 Handle the program interactively in the same terminal or not.
    215 By default this is set to "1".
    216 .It Ev SFEED_PLUMBER
    217 A program that receives the link URL or enclosure URL as a parameter.
    218 By default this is "xdg-open".
    219 .It Ev SFEED_PLUMBER_INTERACTIVE
    220 Handle the program interactively in the same terminal or not.
    221 This option can be useful to open a text-mode browser in the same terminal.
    222 By default this is set to "0".
    223 .It Ev SFEED_YANKER
    224 A program where the URL or enclosure field is piped to, to copy it to a
    225 clipboard.
    226 By default this is "xclip -r".
    227 .It Ev SFEED_YANKER_INTERACTIVE
    228 Handle the program interactively in the same terminal or not.
    229 By default this is set to "0".
    230 .It Ev SFEED_URL_FILE
    231 If this variable is set then a different mode is used to mark items as read,
    232 instead of checking the timestamp, which is the default.
    233 The value specified is a plain-text file containing a list of read URLs, one
    234 URL per line.
    235 This URL is matched on the link field if it is set, otherwise it is matched on
    236 the id field.
    237 .It Ev SFEED_MARK_READ
    238 A program to mark items as read if
    239 .Ev SFEED_URL_FILE
    240 is also set, if unset the default program used is "sfeed_markread read".
    241 The marked items are piped to the program line by line.
    242 If the feed item has a link then this line is the link field, otherwise it is
    243 the id field.
    244 The program is expected to merge items in a safe/transactional manner.
    245 The program should return the exit status 0 on success or non-zero on failure.
    246 .It Ev SFEED_MARK_UNREAD
    247 A program to mark items as unread if
    248 .Ev SFEED_URL_FILE
    249 is also set, if unset the default program used is "sfeed_markread unread".
    250 The unmarked items are piped to the program line by line.
    251 If the feed item has a link then this line is the link field, otherwise it is
    252 the id field.
    253 The program is expected to merge items in a safe/transactional manner.
    254 The program should return the exit status 0 on success or non-zero on failure.
    255 .It Ev SFEED_LAZYLOAD
    256 Lazyload items when reading the feed data from files.
    257 This can reduce memory usage but increases latency when seeking items,
    258 especially on slower disk drives.
    259 It can also cause a race-condition issue if the feed data on disk is changed
    260 while having the UI open and offsets for the lines are different.
    261 A workaround for the race-condition issue is by sending the SIGHUP signal to
    262 .Nm
    263 after the data was updated.
    264 This makes
    265 .Nm
    266 reload the latest feed data and update the correct line offsets.
    267 By default this is set to "0".
    268 .It Ev SFEED_FEED_PATH
    269 This variable is set by
    270 .Nm
    271 when a feed is loaded.
    272 If the data was read from stdin this variable is unset.
    273 It can be used by the plumb or pipe program for scripting purposes.
    274 .El
    275 .Sh INTERACTIVE AND NON-INTERACTIVE PROGRAMS
    276 .Nm
    277 can pipe content, plumb and yank interactively or in a non-interactive manner.
    278 In interactive mode
    279 .Nm
    280 waits until the process exits.
    281 Stdout and stderr of the program are written as output.
    282 It stores and restores the terminal attributes before and after executing the
    283 program.
    284 The signals SIGHUP and SIGWINCH will be handled after
    285 .Nm
    286 has waited on the program.
    287 SIGINT is ignored while waiting on the program.
    288 .Pp
    289 In non-interactive mode
    290 .Nm
    291 doesn't wait until the process exits.
    292 Stdout and stderr of the program are not written as output.
    293 When plumbing an URL then stdin is closed also.
    294 .Sh EXIT STATUS
    295 .Ex -std
    296 The exit status is 130 on SIGINT and 143 on SIGTERM.
    297 .Sh EXAMPLES
    298 .Bd -literal
    299 sfeed_curses ~/.sfeed/feeds/*
    300 .Ed
    301 .Pp
    302 Another example which shows some of the features
    303 .Nm
    304 has:
    305 .Bd -literal
    306 export SFEED_AUTOCMD="2tgo"
    307 export SFEED_URL_FILE="$HOME/.sfeed/urls"
    308 [ -f "$SFEED_URL_FILE" ] || touch "$SFEED_URL_FILE"
    309 sfeed_curses ~/.sfeed/feeds/*
    310 .Ed
    311 .Pp
    312 Which does the following:
    313 .Bl -enum
    314 .It
    315 Set commands to execute automatically:
    316 .Pp
    317 Set the current layout to a horizontal mode ('2' keybind').
    318 Showing a feeds sidebar on the top and the feed items on the bottom.
    319 .Pp
    320 Toggle showing only feeds with new items in the sidebar ('t' keybind).
    321 .Pp
    322 Go to the first row in the current panel ('g' keybind).
    323 .Pp
    324 Load the current selected feed ('o' keybind').
    325 .It
    326 Set a file to use for managing read and unread items.
    327 This is a plain-text file containing a list of read URLs, one URL per line.
    328 .It
    329 Check if this file for managing the read and unread items exists.
    330 If it doesn't exist yet then create an empty file.
    331 .It
    332 Start
    333 .Nm
    334 and read the specified feed files.
    335 .El
    336 .Sh SEE ALSO
    337 .Xr sfeed 1 ,
    338 .Xr sfeed_content 1 ,
    339 .Xr sfeed_markread 1 ,
    340 .Xr sfeed_plain 1 ,
    341 .Xr xclip 1 ,
    342 .Xr sfeed 5
    343 .Sh AUTHORS
    344 .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org