~ft/zuke

9a9b8477a8dec9fd05b97ddfda316f86dae8fb20 — Sigrid Haflínudóttir 7 months ago 8952c92
add -s option to start in shuffled mode
2 files changed, 13 insertions(+), 2 deletions(-)

M README.md
M zuke.c
M README.md => README.md +2 -0
@@ 48,6 48,8 @@ T  track number
p  file path
```

With `-s` zuke will start in shuffled mode.

## Hot keys

```

M zuke.c => zuke.c +11 -2
@@ 850,7 850,7 @@ toggleshuffle(void)
static void
usage(void)
{
	fprint(2, "usage: %s [-c aAdDtTp]\n", argv0);
	fprint(2, "usage: %s [-s] [-c aAdDtTp]\n", argv0);
	sysfatal("usage");
}



@@ 867,9 867,13 @@ threadmain(int argc, char **argv)
		{ nil, &key, CHANRCV },
		{ nil, nil, CHANEND },
	};
	int fd, n, scrolling, oldpcur, oldbuttons, pnew;
	int fd, n, scrolling, oldpcur, oldbuttons, pnew, shuffled;

	shuffled = 0;
	ARGBEGIN{
	case 's':
		shuffled = 1;
		break;
	case 'c':
		cols = EARGF(usage());
		if(strlen(cols) >= nelem(colwidth))


@@ 914,6 918,11 @@ threadmain(int argc, char **argv)
		close(fd);
	}

	if(shuffled){
		pcur = nrand(plnum);
		toggleshuffle();
	}

	themeinit();
	redraw(1);
	oldbuttons = 0;