Remembers what file in the directory you viewed last time. Enumerates all files in the directory and allows to reference them only by a number.
Requires Ruby >= 2.5.0.
gem install episode
Clone this repository and add episode/bin
to your $PATH
.
Episode creates .episode
file in the current directory when you open some file with it. By default it will be looking for mkv
, avi
or mp4
files and will use xdg-open
as the viewer. Read examples below to see how to change this behavior.
List episodes in the current directory.
ep
Watch episode #7
ep 7
Watch next episode
ep next
Watch with mpv
ep 7 -v mpv
Make mpv default player for this directory (add -g
to make it global)
ep set viewer mpv
Show config for the current directory
ep cfg
Show global config
ep cfg -g
Usage: ep <command> [options]
Quick start:
ep ls Show episodes in the current directory with their numbers
ep Same as `ep ls`
ep 7 Play episode #7
ep next Play next episode (or first)
ep set viewer mpv -g Use mpv as default file viewer (by default it's xdg-open)
Commands:
ls List all episodes and their numbers
<number-or-file> Same as `ep play <number-or-file>` (e.g. `ep 11`)
play <number-or-file> Play episode (e.g. `ep play 11`)
(s) status Show information about last view
(l) last Re-play episode watched last time
(n) next Play next episode
(p) prev Play previous episode (one before 'last')
(c) cfg Show config
set <param> <value> Set config parameter (e.g. `ep set last 11`)
(r) reset [param] Reset config parameter (e.g. `ep reset last`)
Options for `play`, `last`, `next`, and `prev`:
-n, --name Show episode name, but don't play it (e.g. `ep -n 11`)
-o, --no-update Don't update .episode file
-v, --viewer <program> Specify what viewer to use (e.g. `ep 7 -v mpv`)
Options for `cfg`, `set`, and `reset`:
-g, --global Edit (or show) global config ($HOME/.config/episode)
ep -g set pointer '\u001b[33;1m*\u001b[0m'
ep r
ep r -g
ep set formats png,jpg
ep set viewer feh
ep set formats pdf
ep set viewer zathura
ep set formats ''
ep set viewer 'hexdump -C'
# Invoking:
ep next | less
Since episode
creates an .episode
file with local configuration in the directory, you can't use it in read-only directories.
However, we can work around this limitation by changing dir
parameter.
First, create a new directory
mkdir placeholder && cd placeholder
Then set parameter dir
to point to the target directory
ep set dir /path/to/readonly/directory
This way episode
will list and track files from /path/to/readonly/directory
instead of placeholder
directory.