phosphor(6x)

πŸ’– phosphor(6x) β€” the XScreenSaver manual, but make it make sense πŸ’–

okay bestie so this page lives in the XScreenSaver manual and honestly? it's lowkey iconic. today we're talking about phosphor and I'm genuinely obsessed. let's get into it πŸ‘‘


🌈 NAME 🌈

phosphor β€” it simulates an old terminal with long-sustain phosphor. that's the whole vibe. a CRT ghost from 1978 but make it your screensaver πŸ’…


✨ SYNOPSIS ✨

phosphor [--display host:display.screen] [--window] [--root]
[--window-id number][--install] [--visual visual] [--font font] [--scale
int] [--ticks int] [--delay usecs] [--program command] [--meta] [--esc]
[--bs] [--del] [--fps]

like, that's the whole invocation, no notes 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so phosphor draws text on your screen in a very large pixelated font that looks exactly like an old low resolution dumb tty. the pixels flare and fade out as if the phosphor was very long-sustain (iykyk β€” that's literally where the name comes from, the glow that lingers on old CRT monitors πŸŽ€).

and here's the flex: it's also a fully functional vt100 terminal emulator. not a screensaver pretending, an actual real one. main character energy fr fr 😭


πŸ’… OPTIONS πŸ’…

phosphor accepts the following options, and yes we're going through all of them, no skipping:

  • --window β€” Draw on a newly-created window. this is the default, so if you do nothing, you get this 🫢
  • --root β€” Draw on the root window. like, right on the desktop itself.
  • --window-id number β€” Draw on the specified window. you pick the window, it draws there.
  • --install β€” Install a private colormap for the window.
  • --visual visual β€” Specify which visual to use. legal values are the name of a visual class, or the id number (decimal or hex) of a specific visual. hex counts, she's flexible ✨
  • --font font-name β€” The X font to use. phosphor can take any font and scale it up to pixelate it. the default is fixed.
  • --scale int β€” How much to scale the font up: in other words, the size in real pixels of the simulated pixels. default 6. so a 6 stays a 6, don't @ me.
  • --ticks int β€” The number of colors to use when fading to black. default 20. that's your fade-out gradient, bestie 🌸
  • --delay usecs β€” The speed of the terminal: how long to wait between drawing each character. default 50000, or about 1/20th second. yes, microseconds. tiny tiny slices of time ⏳
  • --pty β€” Launch the sub-program under a PTY, so that it can address the screen directly. this is the default.
  • --pipe β€” Launch the sub-program at the end of a pipe: do not let it address the screen directly.
  • --program sh-command β€” The command to run to generate the text to display. this option may be any string acceptable to /bin/sh. the program will be run at the end of a pty or pipe, and any characters that it prints to stdout will be printed on phosphor's window. the characters will be printed artificially slowly, as per the --delay option above. if the program exits, it will be launched again after 5 seconds. (yes, it respawns. it's persistent like that πŸ’€)

for example:

phosphor --program 'ping 8.8.8.8'
phosphor --program 'ps -e'
phosphor --program 'od -txC -w6 /dev/random'
phosphor --program 'cat /dev/random'
phosphor --scale 2 --program 'top'
phosphor --scale 4 --program 'mtr www.kernel.org'
phosphor --scale 4 --program 'emacs -nw -q -f life'
phosphor --scale 4 --program 'emacs -nw -q --eval "(hanoi 5)"'

and if you have the festival(1) text-to-speech system installed, you can have it read the screen as phosphor prints it 🎀:

phosphor --program \
    'xscreensaver-text | tee /dev/stderr | festival --tts'

you can also use phosphor as a lo-fi replacement for the xterm(1) and gnome-terminal(1) terminal emulators:

phosphor -delay 0 -program $SHELL

(note: -delay, not --delay, in that last one. that's exactly how it's written. keep it exactly like that, bestie 🫢)

  • --esc β€” When the user types a key with the Alt or Meta keys held down, send an ESC character first. this is the default.
  • --meta β€” When Meta or Alt are held down, set the high bit on the character instead.
  • --del β€” Swap Backspace and Delete. this is the default.
  • --bs β€” Do not swap Backspace and Delete.
  • --fps β€” Display the current frame rate and CPU load. numbers on screen, we love a performance readout πŸ”₯

🧚 TERMINAL EMULATION 🧚

okay this part is genuinely so cool, pay attention πŸ’œ

by default, phosphor allocates a pseudo-tty for the sub-process to run under. and this has the desirable side effect that the program will be able to use ioctl(2) to fetch information about terminal parameters and window size β€” which many programs (such as top(1)) need to run properly. so like, top actually works, which is a slay.

phosphor will also set the environment variable TERM to vt100 in the child process.

any characters typed on the phosphor window will be passed along to the sub-process. πŸŽ€

⚠️ note that this only works when running in "window" mode, not when running in --root mode under xscreensaver. so if you're typing and nothing happens, check your mode, bestie 😭

πŸ‘‘ ENVIRONMENT πŸ‘‘

  • DISPLAY to get the default host and display number.
  • XENVIRONMENT β€” to get the name of a resource file that overrides the global resources stored in the RESOURCE_MANAGER property.
  • XSCREENSAVER_WINDOW β€” The window ID to use with --root.
  • TERM to inform the sub-process of the type of terminal emulation.

⭐ SEE ALSO ⭐

the whole friend group, in order:

xscreensaver(1), xscreensaver-text(6x), fortune(1), apple2(6x), starwars(6x), fontglide(6x), ljlatest(6x), dadadodo(1), webcollage(6x), driftnet(1) EtherPEG, EtherPeek, console_codes(4).

(and yes, EtherPEG and EtherPeek have no man page section numbers in there. that's how it is. don't come for me πŸ™ˆ)


Copyright Β© 1999 by Jamie Zawinski. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. No representations are made about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.

(that's the legal bit verbatim, because legally you don't get to vibe-check a license 🫢)


🌸 AUTHOR 🌸

Jamie Zawinski <jwz@jwz.org>, 27-Apr-99. Pty and vt100 emulation by Fredrik Tolf <fredrik@dolda2000.com>.


okay and the cute sign-off: this page is from X Version 11, version 6.09, dated 07-Jun-2024, and it's phosphor(6x) in case you lost track πŸ’–βœ¨πŸŽ€

periodt. go run it with --program 'cat /dev/random' and enjoy the chaos 🌈

πŸ“¦ where this page comes from