Showing posts with label macOS. Show all posts
Showing posts with label macOS. Show all posts

Sunday, August 9, 2026

"It's a Unix system!", or, Porting fsv to macOS with Metal



If you've seen Jurassic Park, you've seen fsn: the 3D file browser Lex uses to lock the raptors out of the control room. It was a real program, written at SGI for IRIX workstations, and its source code never left the building. What the rest of us got, a few years later, was fsv, a GTK+/OpenGL clone by Daniel Richard G. that lays out your directories as geometry you can fly around in.

I wanted it on my Mac. The problem: fsv is a GTK3 + OpenGL application, Apple deprecated OpenGL back in 2019, and I did not fancy an XQuartz-flavoured build of a 3D flythrough. So it got a real port instead. The code lives at github.com/w3cdotorg/fsv (the metal-port branch, which is the default one), with prebuilt binaries on the Releases page.

What changed under the hood

The renderer is now SDL3’s GPU API (Metal on macOS, Vulkan-capable elsewhere), with the shaders ported to modern GLSL and compiled offline to MSL and SPIR-V. The GTK interface was rebuilt in Dear ImGui (menu bar, docked directory tree and file list, colour setup, properties dialogs), and the core of fsv (filesystem scanning, geometry layout, camera math) was extracted into a headless library with its own little CLI and unit tests. Picking is done the modern way, with a colour-ID offscreen readback, so hovering and right-clicking resolve the actual node under the cursor. And while the SDL/Metal frontend is the point of all this, the legacy GTK/OpenGL one still builds and runs on Linux; CI keeps it honest on every push.

Along the way, a surprise: nvstore.c, the settings-persistence backend, turned out to be a complete stub upstream ("ALL THIS HAS YET TO BE IMPLEMENTED!"), on both frontends. fsv has been silently discarding every colour-setup change since the nineties. It now writes ~/.fsvrc for real.

The FSN mode

The original SGI program was never released, but it left traces: screenshots, a 1992 README, and two SGI patents (US5555354 for the flight navigation, US5861885 for the selection spotlight). From those, the port grew a fourth visualisation mode (--fsn, or Vis → FSN) recreating the film’s look: gradient sky over the green ground plane, directory pedestals whose height tracks subtree size, file boxes coloured by age with the classic legend bar at the bottom, and white wires connecting parent to child. Middle-drag flies the camera around, patent-style. Double-clicking a pedestal warps down onto it; double-clicking a file opens it with the default app, which is exactly how Lex locked that door.

Building it

Everything comes from Homebrew:

$ brew install glib cglm meson ninja pkgconf sdl3

$ git clone https://github.com/w3cdotorg/fsv.git && cd fsv

$ meson setup builddir

$ ninja -C builddir

$ ./builddir/src/sdl/fsv ~/some/directory

That is the whole build. packaging/macos/make-bundle.sh wraps the binary into a double-clickable .app, and there is an Xcode project (packaging/xcode) for those who would rather hit Cmd-B. The prebuilt binaries from the Releases page still expect Homebrew’s glib and sdl3 at runtime (the dylibs are not bundled yet; it is in the TODO), so brew install glib sdl3 first, or the loader will complain.

On Linux, the classic GTK frontend builds with the usual libgtk-3-dev / Mesa dev packages (meson setup builddir -Dfrontend=gtk). The new SDL frontend works there too, provided you have SDL3 ≥ 3.2 (most distributions do not package it yet; Ubuntu gets it in 25.10).

How it was made

Full disclosure: the port was done in pair with Claude, Anthropic’s coding agent, task-by-task. Every step, decision, dead end and bug found along the way is written down in docs/PORTING.md, which ended up being a document I enjoy re-reading more than some of the code. The leftover rough edges (including the rewrite of the MapV treemap layout that the original author was already wishing for in his 1999 TODO) are collected in TODO.md.

That’s it! If you take it for a spin, or if you remember fsn from an actual Indigo, let me know in the comments (or on the GitHub issues).

Monday, June 15, 2020

Slackware64-current with KDE Plasma in Parallels Desktop on macOS

Introduction

I like working from macOS (Catalina, 10.15). I have my habits since 2006 and, now, with iTerm2 + zsh and a few plugins, plus other software (TextMate...), life is good. But there will always be that one moment in your work life where you find yourself wishing you had a GNU/Linux distro at hand, just to try something real quick. Anyway, that's my case.

Unfortunately, I was in a bit of a conundrum: I have the bad habit of getting every distro with a package manager FUBAR in a few months' time. Yes, I'm looking at you, Debian, and at your derivatives [OpenSUSE: you're ok; for everyone else: YMMV]. In macOS, I'm using Parallels Desktop, so at least it's easy to save a working version of the virtual machine before attempting things. I have had some very good luck running OpenSUSE Tumbleweed in Parallels Desktop in the past years, but for some reason when I installed it yesterday it... Didn't ran, and just spent time taking 100% of the processors in the VM (I let it run on 6 cores, 4GB RAM, 1GB video RAM) while trying to load the desktop, after an installation process that went quite well.

I decided to go back to my early teenager-years distro: Slackware, and to what's in my opinion the best desktop environment of this time, KDE Plasma (I've always had a soft spot for Enlightenment, howerver, and I find that the Solus distro gives good options and a nice desktop [with Budgie/Gnome/Mate/Plasma available], for anyone wanting something simple -- but it doesn't work well in Parallels Desktop). Due to a specific Wifi driver in the beginning of the 2000s, I had to use Slackware and recompile the kernel to get Internet to work. I learnt a lot. Would that still work in 2020? Yes, with a few limitations.

Limitations

Let's get right now to the limitations: I haven't been able to install Parallels Tools. As such, I don't have access to my macOS folders from Slackware, neither can I resize the Parallels window to have the X server change the resolution. I tried installing Parallels Tools using the "hack" of deleting the check for requirements (particularly the package manager) but it borked my Xorg install, so use at your own risk.

Installation

Installation itself went smoothly: download the DVD in torrent, select it as boot device in Parallels, and choose your packages. I did make one more partition than needed, for /boot/, because I knew I wanted to go the grub way. I deselected all the KDE packages, as they are part of the KDE 4 version. After installation, I choose to not install Lilo and followed the procedure here to install grub at first install.

After the first boot, I created a user, and followed the mkinitrd procedure here, just to have a cleaner boot. I initially tried adding my configuration in /etc/grub.d/40_custom but after a few updates & upgrades the new kernel was automatically added to grub.

Upgrade

I followed the system upgrade procedure here: blacklist the kernel in /etc/slackpkg/blacklist, manually upgrade the kernel and modules (by downloading them from one of the mirrors), update the initrd, and finally select a mirror for slackware64-current in /etc/slackpkg/mirrors. 
 
A last grub update :
 
# grub-mkconfig -o /boot/grub/grub.cfg
 
Then: 
# slackpkg update gpg
# slackpkg update
# slackpkg upgrade slackpkg
# slackpkg upgrade glibc-solibs
# slackpkg install-new
# slackpkg upgrade-all
# slackpkg clean-system
# slackpkg new-config
Then a reboot, for luck.

Plasma 5

Installing Plasma 5 can be a bit daunting, if you look at the readme file. But, thanks to AlienBob and Epsi, the procedure is quite simple. First, make sure your system is up-to-date and everything, then manually install slackpkgplus. Enable (add) the ktown repository in /etc/slackpkg/slackpkgplus.conf, and continue the procedure following Epsi's instructions (update GPG, update, etc.).

As root, I deleted (just for luck) /etc/X11/xorg.conf-vesa and didn't run X -configure. With Parallels Tools, I had the "EE No usable screen(s) found" error in X, but by default this seems to work fine! 

Finally, as a user, I launched startx just to make sure, and then in xwmconfig I selected the Plasma Desktop.

When I was sure that everything was setup right, I changed the init to level 4 in /etc/inittab, and rebooted to KDM. I was able with a bit of fiddling to get my MacBook Pro keyboard working with the right layout in Plasma, and to configure zsh as I wanted (in Konsole).

That's it! If you had any luck installing Parallels Tools and getting X to work in Slackware64-current on Parallels Desktop, please let me know. If you have questions about my setup, I'll be happy to answer them in the comments.