selection mode. You can add more files to the selection and edit the list
again. If no file is selected in the current session, this option attempts
to list the selection file.
+.Pp
+.Nm
+can show the total size of non-filtered selected files listed in a
+directory. For directories, only the size of the directory is added by
+default. To add the size of the contents of a directory, switch to du mode.
.Sh FIND AND LIST
There are two ways to search and list:
.Pp
"ca Select all%-14cA Invert sel\n"
"9p ^P Copy here%-12cw ^W Cp/mv sel as\n"
"9v ^V Move here%-15cE Edit sel list\n"
- "9x ^X Delete%-16cEsc Send to FIFO\n"
+ "9x ^X Delete%-18cS Listed sel size\n"
+ "aEsc Send to FIFO\n"
"0\n"
"1MISC\n"
"8Alt ; Select plugin%-11c= Launch app\n"
return cfg.filtermode;
}
+static void showselsize(const char *path)
+{
+ off_t sz = 0;
+ int len = scanselforpath(path, FALSE);
+
+ for (int r = 0; r < ndents; ++r)
+ if (findinsel(findselpos,
+ len + xstrsncpy(g_sel + len, pdents[r].name, pdents[r].nlen)))
+ sz += cfg.blkorder ? pdents[r].blocks : pdents[r].size;
+
+ printmsg(coolsize(cfg.blkorder ? sz << blk_shift : sz));
+}
+
static bool browse(char *ipath, const char *session, int pkey)
{
alignas(max_align_t) char newpath[PATH_MAX];
if (g_state.runplugin == 1) /* Allow filtering in plugins directory */
presel = FILTER;
goto begin;
+ case SEL_SELSIZE:
+ showselsize(path);
+ goto nochange;
case SEL_SHELL: // fallthrough
case SEL_LAUNCH: // fallthrough
case SEL_PROMPT:
SEL_AUTONEXT,
SEL_EDIT,
SEL_PLUGIN,
+ SEL_SELSIZE,
SEL_SHELL,
SEL_LAUNCH,
SEL_PROMPT,
{ 'e', SEL_EDIT },
/* Run a plugin */
{ ';', SEL_PLUGIN },
+ /* Show total size of listed selection */
+ { 'S', SEL_SELSIZE },
/* Run command */
{ '!', SEL_SHELL },
{ CONTROL(']'), SEL_SHELL },