Normalize Identifying Corporate Devices in Your Software

If you dual-license your software in such a way that it requires a paid license for commercial use, here are two code blobs for you.

macOS

pub fn mdm_enrollment() -> eyre::Result<(bool, Option<String>)> {
    let mut command = Command::new("/usr/bin/profiles");
    command.args(["status", "-type", "enrollment"]);
    let stdout = command.output()?.stdout;
    let output = std::str::from_utf8(&stdout)?;
    if output.contains("MDM enrollment: No") {
        return Ok((false, None));
    }

    let mut server = None;

    for line in output.lines() {
        if line.starts_with("MDM server") {
            server = Some(line.trim_start_matches("MDM server: ").to_string())
        }
    }

    Ok((true, server))
}

Windows

pub fn mdm_enrollment() -> eyre::Result<(bool, Option<String>)> {
    let mut command = Command::new("dsregcmd");
    command.args(["/status"]);
    let stdout = command.output()?.stdout;
    let output = std::str::from_utf8(&stdout)?;
    if !output.contains("MdmUrl") {
        return Ok((false, None));
    }

    let mut server = None;

    for line in output.lines() {
        if line.contains("MdmUrl") {
            let line = line.trim().to_string();
            server = Some(line.trim_start_matches("MdmUrl : ").to_string())
        }
    }

    Ok((true, server))
}

Looking at mobile device management (MDM) enrollment is not a silver bullet for identifying corporate devices running your software, but it is a good start.

Read more →

I Want a Cross-Platform Tiling Window Manager

One of the great things about building your own tools is that you get to have your desired workflow and user experience with very few compromises.

I built Notado because I wanted an archiving and highlighting workflow which treated online comments as first class citizens.

I built Kullish because I wanted to be able to quickly aggregate comments about links from a variety of different online communities.

I built komorebi because I wanted a tiling window manager for Windows.

Read more →

Managing Dotfiles on Windows 11 With NixOS

I have a confession to make. Until yesterday, I did not have any form of dotfiles management or versioning for my Windows 11 machine. Yes, I, the person who wrote an entire tiling window manager for Windows from scratch in Rust, did not manage my dots.

I had to sheepishly admit this on more than one occasion in the project Discord server when people would watch my live programming videos and then ask if I could share my Windows dotfiles repo.

Read more →

Yubikey Passthrough on WSL2 With Full FIDO2 Support

I recently starting using Yubikeys both to store passkeys which allow me to do passwordless logins to websites like GitHub, and to SSH into remote servers with FIDO2.

I have a number of machines at home, but I spend the majority of my time using a Windows 11 desktop computer running NixOS on WSL2 (in the past I’ve described Windows 11 + my tiling window manager komorebi as the “desktop environment” on top of my NixOS WSL2 shell).

Read more →

Dynamic vs. Static Config for My Tiling Window Manager

For the last few years I have been writing and maintaining a tiling window manager for Windows that has steadily grown in usage and popularity.

My first exposure to tiling window managers was on macOS with kwm (which was succeeded by chunkwm and later yabai). Naturally, this meant that whenever I used Linux, I would reach for bspwm.

I am a big proponent of what I call the “bspwm architecture” for tiling window managers.

Read more →