Remember the "One Laptop Per Child" project, that developed a low-cost computer for children in developing countries? I was always amazed by a certain feature: The "View Source" button.

When you pressed it, the source code for the currently running application would open. This was supposed to encourage tinkering with the software on your device! <3

I've been pondering what it would take to build that button on modern machines. Has anyone seen something like that?

(Prototype in next toot.)

You'd roughly need to:

- Figure out which program is currently focused
- Figure out the Git repo of this software
- Clone it into a temporary directory
- Set up the required tools to start hacking on it and compile it

As a quick prototype, I wrote a li'l Bash script that does some of these things. It makes heavy use of #nix and #nixpkgs:

https://codeberg.org/blinry/view-source-button

I enters a "dev shell" with the required tools already in the PATH, and even sets up a Git remote to start contributing. :D

view-source-button

A script that allows you to start tinkering with software

Codeberg.org

So if you've been wondering why I'm into obscure bugs this week like:

- Figuring out why I'm missing icons in pavucontrol https://chaos.social/@blinry/116081436255395069

- Improving the man page of a Nix CLI helper https://github.com/nix-community/nh/pull/568

- Reporting broken shortcuts in the Firefox DevTools https://bugzilla.mozilla.org/show_bug.cgi?id=2017113

… it was testcases for tying out this "View Source Button". :P

blinry (@[email protected])

Attached: 1 image Hmm, is anyone else missing this icon in pavucontrol? (On more "bare-bones" window managers, maybe?) I'm trying to figure which piece I'd need to fix here. I'm on #NixOS, but that doesn't seem to be the only reason. :D This seems to be the "emblem-default" icon https://gitlab.freedesktop.org/pulseaudio/pavucontrol/-/blob/master/src/devicewidget.ui?ref_type=heads#L80 which Nix' adwaita-icon-theme doesn't seem to have anymore… The nixpkgs derivation is here: https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/pa/pavucontrol/package.nix #gnome #gtk

chaos.social

It's been fun, it feels like a new superpower to "quickly fix something and send a PR". It's also a super dangerous rabbit hole generator, because now that it's easy to fix stuff, it's very tempting to do so… 🐇

My prototype has some rough edges:

It clones the latest commit, which doesn't always compile using the #nixpkgs setup (but it seems reasonable to check whether the bug is still there).

And invoking the phases of the nixpkgs stdenv manually can be tricky. https://nixos.org/manual/nixpkgs/stable/#sec-building-stdenv-package-in-nix-shell

Nixpkgs Reference Manual

@blinry Everything in me currently screams "Smalltalk" ;-)
@dwardoric @blinry I was thinking Lisp Machines, but, nevertheless, very cool project! :3

@korenchkin @dwardoric @blinry I mean, this is already pretty easy today if you use Emacs for everything =) C-h k gives you hyperlinks straight to the source of any command bound to a keystroke

the main problem is that sometimes your boss makes you use programs that aren't emacs =(

@technomancy @dwardoric @blinry I'm lucky, I can use emacs all day :3