Skip to content
WombatFirst220Public

About

A macOS screen saver that recreates the nostalgic DOS-era disk defragmentation experience — complete with a classic blue color scheme, animated cluster map, and real-time status output.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

MacDefrag

A macOS screen saver that recreates the nostalgic disk-defragmentation experience of several classic operating systems — animated cluster map, real-time status output, switchable retro themes, and optional procedurally-synthesised hard-disk sounds.

Preview

⬇ Download the latest version · How to install


It does not make your SSD faster. It does not fix your filesystem. It does not improve your productivity.

What it does do is fill your screen with a lovingly fake retro defrag display: blue DOS-style colors, animated disk clusters, progress bars, status text, and the comforting illusion that your computer is doing something extremely technical and important.

Perfect for retro-PC fans, old-school nerds, or anyone who thinks “watching colored blocks move around” counts as entertainment.

MacDefrag running on a desk monitor


Features

  • 4-phase animation loop — Scan → Analyze → Defrag → Complete, then seamlessly restarts

  • 80 × 35 cluster grid with a procedurally generated fragmentation pattern using multi-frequency sine waves

  • Five switchable OS themes, each with period-correct chrome and palette:

    Theme Look
    MS-DOS (DEFRAG) Authentic text-mode console: a large cluster map drawn with █ ▓ · r W B glyphs on the left, a Status box (cluster, % complete, elapsed, total) and a Legend box stacked on the right, a top menu bar (Optimize / Method / Drive / Configure) and a bottom key-hint bar — all in double-line box-drawing borders on CGA blue
    Windows 9x Teal desktop with a taskbar (Start button + four-colour flag, app button, clock), a 3D-beveled gray window with a navy gradient title bar and ✕/□/– buttons, sunken white cluster grid, a Defragmenting Drive C — NN% Complete label, a segmented blue progress bar, and Stop / Pause / Legend buttons (blue = contiguous, red = fragmented)
    Classic Mac OS Top menu bar with a rainbow Apple logo (File / Edit / Disk / Special) and clock, a Platinum window with a pinstriped title bar, close/zoom/collapse boxes, drop shadow, Norton-Speed-Disk-style map, and a rounded Stop default button
    OS/2 Warp GammaTech HPFS-Optimizer styling: a WarpCenter strip, beveled WPS-gray window with a system-menu icon and deep-blue title bar, blue/teal HPFS map, and Optimize / Analyze / Exit buttons
    BeOS The signature yellow window tab, a Deskbar (blue B logo + clock) in the top-right corner, a teal desktop, and Defragment / Cancel buttons

    A sixth option, Random, picks a fresh theme on every defrag cycle. All chrome (desktops, taskbar/menu bar/Deskbar, window buttons) is drawn procedurally — no copyrighted screenshots are bundled.

  • 8 distinct block states (Optimized / Used / System / Bad / Reading / Writing / Cleared / Free), re-mapped to each theme's palette. In the default MS-DOS theme each state has its own DOS-palette color:

    Color State
    Bright cyan Optimized (defragmented)
    Light gray Used (not yet moved)
    Teal System / kernel file
    Dark red Bad sector
    Bright red Read head active
    Bright yellow Write head active
    Dim blue Source cluster after move
    Dark blue Free space
  • Optional hard-disk sounds — a continuous platter hum plus seek "ticks" and arm-sweep "chirps" synthesised in real time and timed to the read/write head movements (AVAudioEngine). Toggle and volume live in the settings sheet

  • Live status line with scrolling cluster address counter and elapsed time, plus a progress bar with percentage readout

  • Monospace aesthetic using Menlo in the MS-DOS theme

  • Configuration sheet — pick the theme, enable sounds, and set the volume

  • Preview image shown in the macOS screen saver picker


Requirements

  • macOS 26 Tahoe or later
  • Xcode 26 or later (to build from source)

Installation

No Xcode, no Terminal — just download and double-click.

  1. Download the latest version: MacDefrag.saver.zip (or pick it from the Releases page under Assets).
  2. Unzip it: double-click MacDefrag.saver.zip in your Downloads folder. Safari usually does this for you — you then already see MacDefrag.saver.
  3. Double-click MacDefrag.saver. macOS asks whether to install the screen saver for this user only or for all users of this Mac. Pick one and click Install. The release is signed and notarized by Apple, so there is no “unidentified developer” warning.
  4. Select it: System Settings opens on its own (if not, open Apple menu → System Settings). Go to Screen Saver and click MacDefrag in the list.

That's it. To choose a theme or switch on the hard-disk sounds, see Usage.

Note: Version 0.5 uses the bundle identifier de.johannesehrlich.MacDefrag. If you used an older build, choose your theme and sound settings once again.

Updating to a new version

Download and double-click the new version exactly as above. macOS asks whether to replace the installed one — click Replace. If the old version still shows up afterwards, quit System Settings and open it again, or log out and back in.

Uninstalling

  1. Open System Settings → Screen Saver.
  2. Right-click (or Control-click) MacDefrag and choose Delete “MacDefrag”.

If that menu item is missing, delete the file by hand: in Finder choose Go → Go to Folder… and enter ~/Library/Screen Savers (installed for you only) or /Library/Screen Savers (installed for all users), then move MacDefrag.saver to the Trash.

Building from source

For developers. Requires Xcode 26 or later.

  1. Open MacDefrag.xcodeproj in Xcode
  2. Build with ⌘B
  3. In Xcode's Report Navigator, click the latest build and locate MacDefrag.saver in DerivedData, or run in Terminal:
open ~/Library/Developer/Xcode/DerivedData/MacDefrag-*/Build/Products/Debug/MacDefrag.saver
  1. macOS prompts you to install the screen saver — click Install

Usage

After installation, open System Settings → Screen Saver, select MacDefrag, and enjoy.

Click Options… (the settings sheet) to:

  • Choose a theme (MS-DOS, Windows 9x, Classic Mac OS, OS/2 Warp, BeOS, or Random)
  • Enable hard-disk sounds
  • Adjust the sound volume

Settings are stored via ScreenSaverDefaults and applied on the next cycle.

The animation runs through four phases automatically and loops indefinitely:

  1. Scan — reveals the cluster map block by block while cycling through filesystem paths
  2. Analyze — displays fragmentation statistics (blinking, classic style)
  3. Defrag — animates read/write heads moving clusters into contiguous order
  4. Complete — brief pause before the next cycle begins

Project Structure

MacDefrag/
├── README.md
├── LICENSE
├── MacDefrag_Preview.jpg   # Photo of the screen saver on a desk monitor
├── MacDefrag.xcodeproj
├── docs/
│   └── Recherche-DOS-Programme.md  # Research (German): classic DOS programs as ideas for new themes
├── scripts/
│   ├── notarize.sh         # Build, sign, notarize and staple a release ZIP
│   ├── notarize.conf       # Apple ID and team ID for notarize.sh (no secrets)
│   ├── preview.sh          # Smoke test: Gatekeeper check + render every theme to PNG
│   └── preview/            # Small host program used by preview.sh
└── MacDefrag/
    ├── MacDefragView.h     # ScreenSaverView subclass interface
    ├── MacDefragView.m     # All animation logic and drawing
    ├── MacDefrag.jpg       # Photo of the screen saver in action
    ├── thumbnail.png       # Picker thumbnail (90 × 58)
    └── thumbnail@2x.png    # Picker thumbnail, Retina (180 × 116)

Technical Notes

  • Runs at 30 fps via ScreenSaverView's animateOneFrame
  • The fragmentation layout is regenerated on each startAnimation call using arc4random and sine waves — no two runs look identical
  • Bad clusters are scattered randomly at ~1.5% density
  • The defrag algorithm is a simple left-to-right compaction: the write head advances to the first free slot, the read head finds the next movable block, and they are swapped over three sub-frames (read → write → commit)
  • Theming is fully decoupled from the simulation: a single cluster model drives every theme, which only changes the chrome, palette, and (for MS-DOS) the rendering style. The DOS theme renders the grid as run-length-grouped attributed glyphs in a monospaced font; the GUI themes render colored squares inside theme-specific window chrome
  • Audio is generated by an AVAudioSourceNode render callback: a low platter hum + faint whine, with short filtered-noise "tick" voices (read/write) and a descending "seek" chirp triggered whenever the head jumps more than a row. Voices are added from the animation thread under an os_unfair_lock; the engine is only started for the full-screen saver (never the preview) and only when sounds are enabled

Ideas for new themes

docs/Recherche-DOS-Programme.md (German) collects classic DOS programs whose look would make a good screen saver — ScanDisk, MS-DOS Setup, PKZIP, Norton Commander and more. For each it notes the look, a screenshot source, whether it fits the existing cluster map or needs its own animation, and who owns the name today. Favourites: ScanDisk, MS-DOS 6.22 Setup and PKZIP.


Publishing a release

Requires the “Developer ID Application” certificate of team 28AS78GU5K in the login keychain and an app-specific password for the Apple ID in scripts/notarize.conf.

  1. Set the new version in Xcode (target MacDefrag → General → Version, MARKETING_VERSION).
  2. Run scripts/notarize.sh. Credentials come from the notarytool keychain profile named in notarize.conf (create it once with xcrun notarytool store-credentials), otherwise from the environment variable NOTARY_PASSWORD or the keychain item named in notarize.conf — the password is never stored in the repository. The script builds for Apple silicon and Intel, signs with hardened runtime, submits to Apple, staples the ticket and writes build/release/MacDefrag.saver.zip.
  3. Run scripts/preview.sh. It unpacks the ZIP like a download, checks that Gatekeeper accepts it as notarized, loads the screen saver and writes a snapshot of every theme (preview and full screen) to build/preview/. Nothing is installed and no sound plays. Look at the images.
  4. On GitHub create a release with the tag v<version> (e.g. v0.5) and attach build/release/MacDefrag.saver.zip under exactly that name, so the download links in this README keep working (they always point to the latest release).

License

MIT — see LICENSE for details.

About

A macOS screen saver that recreates the nostalgic DOS-era disk defragmentation experience — complete with a classic blue color scheme, animated cluster map, and real-time status output.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages