Get your daily dose of xkcd directly from the terminal! ๐คฉ
recording.mp4
xkcd is a webcomic created by Randall Munroe. It is a comic of Language, Math, Romance and Sarcasm and a couple of other categories.
If kitty is used as the terminal, the xkcd comic will be rendered directly in the terminal, otherwise the default viewer for PNG images is used. This tool requires fzf to be installed on the machine to filter available comics by their title.
Install this package directly from the Python Package Index (PyPI). The CLI tool requires Python >= 3.8 to be installed.
$ pip install dcs-xkcd-cli
This will install a CLI tool named xkcd
which can be used as described below.
Installation with pipx is similar to the pip variant above, but uses pipx
instead of pip
.
$ pipx install dcs-xkcd-cli
Note that with pipx, this package can be tried out without the need to install it permanently.
$ pipx run dcs-xkcd-cli <args>
$ xkcd show
This functionality requires fzf to be installed.
$ xkcd show --latest
$ xkcd show --random
$ xkcd show --comic-id 207
$ xkcd show --use-kitty
Use this command if the auto-detection of the kitty terminal does not work as expected.
Kitty is auto-detected by inspecting if the $TERM
variable includes the term kitty
.
By default the image is upscaled to the terminal width.
Use the --no-kitty-scale-up
flag to disable this feature if needed.
Under the hood this tool uses a cache which is updated once per day transparently. The cache is used to remember the list of xkcd comics from the archive.
To disable the cache, use the following command
$ xkcd show --no-cache
To update the cache manually, use the following command
$ xkcd update-cache