Is there a way to have Auto-scrolling on Linux for most, or at least some, programs?

If you don't know what auto-scrolling is, it is a feature heavily implemented on many Windows programs that is very useful for many people.

Here is a gif of it in action:

You press the middle mouse button (scroll wheel usually) to activate/deactivate it.

This stack exchange illustrates that chrome and firefox have ways to do it, but I want more "desktop environment" built in that works in most applications. The topic is almost 3 years old, so I thought maybe someone here might know if it is possible.

Text/Code editors and things that just involve a lot of scrolling are the target use cases for this.