Introducing XScreenBane
》Gotta Love XScreenSaver
From my earliest days of using Linux, I was delighted by all of the hacks in XScreenSaver. My favorite was Substrate. Even now I wish I had a clue how it worked.
Off an on I had played with data art / generative art / data visualization and in general trying to make pretty or eye-catching displays. At one job I even used the Phosphor hack in XScreenSaver to turn my workstation into a low-tech monitor for a bunch of internal processes. And it had an ASCII version of the local radar map, too!
Then one day I had an idea for writing my own hack. Grabbed the source, read the docs, hacked hacked hacked, and came up with PidGrid. I’m pretty happy with it! It’s in rotation on most of my computers, even my tiny DevTerm rPi-based device. If you are a Mac-lover and could help make it run on MacOS, hit me up!
I thought about turning some of my other projects into XSS hacks, but trying to translate them to C would be an incredible slog. So of course I looked for ways to write hacks in other languages. You can read all about my journey in trying to make Clojure work with XScreenSaver in this post.
Now I’ve wrapped up all that work into a package:
》Introducing XScreenBane
As of writing this post, XScreenBane is usable but still a beta version. I’ve been running it on multiple systems for at least a month now. If you want to play along, go get XScreenBane on GitHub!
You must have XScreenSaver running first, as this works like a set of new hacks. The GitHub repo explains all of that.
Before declaring a 1.0 version, I have a few things to clean up. Mainly the core
namespace has a bunch of inline defs carried over from the earlier experimentaiton
days. Some of the hack code needs comments, particularly around use of Specter
.
And I only have one color palette. A few more need to be generated along with
a way to configure them.
Getting it tested on a Mac before 1.0 would be great, but I haven’t managed that yet. I should also do some performance tuning :D
I’ve written four hacks for the inital release. These all pull live data from the system to control the output, which has been one of my goals from the beginning.
》arcs
This pulls TCP port data and shows it as a swarm of arcs. Different statuses result in different colors, decorations, and directions. On a busy system it looks quite impressive!
》dirty-window
The idea for this came from a visit to a big warehouse with large window panes,
some missing and the rest very dirty. The hack reads the number of dirty pages
in the kernel and displays a ratio of dirty panes to match. You can see it
respond by running sync
!
》arp-sigils
Arp-sigils was one of the projects I did before to turn the visible MAC addresses from the arp cache into linear sigils. The inspiration here came after a friend visisted the Museum of Icelandic Witchcraft and Sorcery. After pondering how to generate complex glyphs I hit upon the idea of using MAC addresses. This hack is the result.
》mandala
Imagine a colorful XLoad but for TCP stats. Each ring of the manadala is related to stats like packets in or out, multicast packets, etc. More activity means a fuller, rounder petal. But a lack of activity turns them inward, making the ring spiky.
》A Request for Your Hacks
I would absolutely love to have people contribute hacks to this project, and I hope I’ve made the code easy enough to understand so that adding a hack would not be a challenge.
Each hack is expected to have a set-up-state
and a draw
function. All you
have to do is draw into the BufferedImage
provider to draw
. I’ve been
using the fantastic Clojure2D project,
but you can lean on AWT if you’re a touch more masochistic than me.
There are template hacks for both AWT and Clojure2D. Just copy one over to new hack and update the namespace.
There is also a color
namespace that includes palette functions. I’ve
attempted to define the palettes "semantically" so they can be used in
different ways in each hack. Beyond the main :background
color,
it is divided into :lines
and :gradients
. This code is the most
likely to change before a 1.0 version is released. I’m open to suggestions
on better ways to define palettes.
》A Final Note
Why bother? Because I have too many screens and want to put interesting things on them. Because there are so many neat data art projects, and I wanted to give people a place to put them that’s not a web browser. Because I like to have ongoing projects to keep my brain working.
But also I’m reminded of this exchange on jwz.org:
Matthew Miller:
I loved XScreenSaver back in the day. But, fundamentally,
their time is gone. To "save" screens in 99.9999% of
situations, the screen should just be going to sleep
to conserve power. And for most of those, so too should
the rest of the system.
jwz:
Who hurt you? Why is there no joy in your heart? *plonk*
plonk indeed.