summaryrefslogtreecommitdiff
path: root/posts/2026-07-25_inner-thoughts.md
blob: b8966a68233253cfbc3df0d9d1f68e441d40dcb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
title: Inner Thoughts Regarding an Insignificant Program
date: 2026-07-25 00:00
---
_All I want is the `discid` submission URL._

This thing I do, where I rake through `.bash_history` to find my `nix-shell` Python one-liner is ridiculous.
Perhaps I put it in `~/.local/bin`.
Then I could at least remember what to run.

All I want is the `discid` submission URL _via a memorable script._

That won't work for me.
One thing I can't stand is stray Python environments marring my machine's spotless file system.
But I also can't be calling `nix-shell` all the time.
I suppose I could put it in my system config with `writePython3Bin`.

All I want is the `discid` submission URL via a memorable script _built in my system configuration._

Wait, I'm always copy-and-pasting it from the terminal into the browser.
I should have the command pipe the URL into `xdg-open` so it pops right up.

All I want is the `discid` submission URL via a memorable script built in my system configuration _that opens the page in my browser._

It works!
That wasn't hard at all.
This is a truly crafty set up... but pulling in all of Python is nagging me.
It's so simple, which makes it so suspect.
When I look at the C library the Python depends on, `libdiscid`, there's already an example C program that does almost exactly what I want.
I just have to shear it down a bit.

All I want is the `discid` submission URL via a memorable script built in my system configuration that opens the page in my browser _with minimal dependencies._

I know the UNIX philosophy is "do one thing and do it well", but this is unreasonable.
Perhaps I can make it accept a command line argument that specifies what info from `libdiscid` to output.
There could be all sort of useful info in there.
Perhaps I can output to JSON and use `jq` to nab what I need.
Or use a simple key-value pairs and extract with `sed`.
Yes, that would be the `discid` printer of my dreams.
The one to rule them all!

_All I want is to wring everything possible out of what `libdiscid` knows about the silly little polycarbonate platter currently in my drive and then I can finally..._

Never mind.

<aside role="note">
    The resulting insignificant program can be found at <a href="https://git.hwebs.info/discidurl">https://git.hwebs.info/discidurl</a>.
</aside>