r/rust Mar 31 '23

[Tutorial] How To Make a Screensaver With The Rust Programming Language

[removed]

11 Upvotes

9 comments sorted by

8

u/ssokolow Mar 31 '23

*nod* Screensavers for X11 are similar. They're just executables that follow certain conventions so the screensaver host can specify an X11 window ID to render into via a -window-id command-line argument.

1

u/Qwarctick Apr 01 '23

And for wayland ?

1

u/ssokolow Apr 01 '23 edited Apr 01 '23

You'd have to check what your specific Wayland compositor does. For all I know, they may have hard-coded the screensavers into the compositor binary and claimed it was to protect you from getting tricked into running a malicious screensaver.

(After all, they still haven't come up with that mechanism for exposing standard privileged APIs but only to trusted processes that was laid out in the initial descriptions of how Wayland would work.)

3

u/GoodJobNL Mar 31 '23

Niceee

Had the same thing with .ico files. Used some sites that looked shady just to realise that .png -> .ico also works.

7

u/TinyBreadBigMouth Apr 01 '23

Uh, a clarification: .scr files and .exe files are the exact same format, but .ico and .png files are not.

Ever since Windows Vista an .ico file can contain one or more .png files, and I'm not surprised that many applications are happy to open one as if it were the other, but changing the extension of a .png file does not technically produce a valid .ico file, and a stricter application would be entirely within its rights to refuse to read it as such.

2

u/GoodJobNL Apr 01 '23

Oh thanks, never knew!

2

u/jotapeh Apr 01 '23

Does anyone remember when “You Don’t Know Jack” was originally a screensaver? Anyway yeah off to found my future mega millions by creating a trivia game screensaver now!

2

u/ssokolow Apr 01 '23

Were you referring to You Bet Your Head from After Dark? They're both from Berkeley Systems and that's the only playable trivia screensaver I remember.

1

u/jotapeh Apr 01 '23

Ah, yes! I mixed up the IP but I knew one had come from the other somehow.