What Linux C developers do is use the xscreensaver API. Here is a description:

================================================== ========================
The XScreenSaver API
================================================== ========================

- Start with #include "screenhack.h"

- Define 2 global variables:

yoursavername_defaults -- Default values for the resources you use.
yoursavername_options -- The command-line options you accept.

- Define 5 functions:

yoursavername_init -- Return an object holding your global state.
yoursavername_draw -- Draw a single frame, quickly.
yoursavername_free -- Free everything you've allocated.
yoursavername_reshape -- Called when the window is resized.
yoursavername_event -- Called when a keyboard or mouse event happens.
The "reshape" and "event" functions are only
called when running in a window (not as a
screen saver). It's ok for them to do nothing.

- All other functions should be static.

- The last line of the file should be
XSCREENSAVER_MODULE ("YourSaverName", yoursavername)

- Finally, edit the Makefile to add a rule for your program.
Just cut-and-paste one of the existing rules.

Your "draw" must not run for more than a fraction of a second without
returning. This means "don't call usleep()". Everything has to be a
state machine.

You may not store global state in global variables, or in function-local
static variables. All of your runtime state must be encapsulted in the
"state" object created by your "init" function. If you use global or
static variables, your screen saver will not work properly on MacOS.

Do not call XSync() or XFlush(). If you think you need to do that, it
probably means that you are you are relying on the speed of the graphics
card for timing, which probably means that your "draw" function is
taking too long.
So you can see it's quite easy to do it in C. It seems that we would need to translate all of the xscreensaver code, or the guts of it, to get a Pascal version working. Or maybe just the screenhack.h header?

I think this should be a challenge. Write a Linux screensaver in Object Pascal!