cmatrix(1), a scrolling
"Matrix" screen runnable in a terminal (implemented in
C and ncurses), can easily be adapted to be invoked from your i3 session.
Be aware: once you followed the intructions in this howto, you won't have a locking cmatrix screensaver. If the key to quit cmatrix is known, someone can access your system easily. Or, a running cmatrix instance may also be circumvented by invoking i3 shortcuts.
In order to do this, add following snippet (where xterm/rxvt/urxvt can be used
interchangeably) to your i3 configuration file (usually, located at either
~/.i3/config or ~/.config/i3/config):
# screensaver
for_window [title="^i3_cmatrix_screensaver$"] fullscreen enable
bindsym Control+$m+s exec xterm -title i3_cmatrix_screensaver -e cmatrix
$m stands for the floating modifier variable which can be set as follows:
# set floating modifier variable
set $m Mod1
If your terminal colors don't match or your terminal has a scrollbar, you might
ought to tweak your ~/.Xdefaults file by adding following:
xterm*background:black
xterm*scrollBar:false
Again, xterm/rxvt/urxvt can be used interchangeably.
Then, logout ($m+Shift+e) and in again, or reload your configuration file ($m+Shift+c)
to activate the setting.
Launch cmatrix in fullscreen mode by pressing Control+$m+s (as configured earlier)
and watch the glyphs flow!
(And if you get bored with it or if your boss is approaching your desk,
exit (quickly) with 'q').
If you like this howto, you might also find following interesting
(which simulates the screen Neo faces shortly after he woke up in his apartment):
sandbox/c/matrix.c.
Compile with:
$ gcc matrix.c -o matrix -lncurses
If linker warnings pop up, try installing libncurses-dev (Debian/Ubuntu)
or similar.
Run with:
$ ./matrix
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled
"GNU Free Documentation License".
Copyright (c) 2025 Steven Schubiger <stsc@refcnt.org>