Improv Show

Wow, it was so great seeing Toshimaru Nakamura again. There was a period like… 20? years ago? where musicians like Nakamura, Sachiko M and Otomo Yoshihide were here like every other month, but it’s been a while now…

Fantastic. I want to go back to Japan now and just go to every one of his shows.

Using Emacs to Monitor Dbus

Sure, sure, I make problems for myself by insisting on having things “just right”… for me. This blog post is about trying to fix those self made problems.

OK, thing the first:

See that “Turn on power saver mode when battery power is low” thing? Yes, indeed, it’s an on/off toggle: You’re not allowed to specify what “low” is. You used to be able to do that in Gnome Shell, but that was apparently not user friendly enough. (For all I know, perhaps you’re still allowed to do that somehow, but google didn’t help.)

It turns out that this is 20%, which I guess is a reasonable value… IF YOU”RE CHICKENSHIT! When the machine is in “power saver mode”, you can basically not use it normally (it dims the screen after a couple seconds of inactivity etc and nags at you), so you’re giving up one fifth of your effective battery capacity.

So for years, I’ve just switched it off, and if I forget to notice the battery indicator has counted down to 0%, well, then the machine switches itself off in the middle of me typing something.

Thing the second:

When I close the lid of the laptop, I don’t want anything to happen (except switching the screen off). In particular, I don’t want the machine to go to sleep, because I normally have several network connections up, and I don’t want those to be lost willy nilly.

That is, I close the lid routinely to move around and futz around in general, and I don’t want that to be disruptive in any way — and I certainly don’t want to be one of those people that walk around with a half-open laptop! The horrors!

(Our model is here demonstrating the proper way to hold a laptop while walking around.)

The lid action used to be handled by the desktop environment, but in their infinite wisdom, this (as most everything else) has moved to systemd:

HandleLidSwitch=ignore

And this… makes the laptop ignore me closing the lid. And ignore means ignore — it doesn’t switch the screen off, either!

I mean, it’s not a catastrophe, but…

Finally, thing the third:

Since 1997, I’ve used an Emacs-based music player. (Three decade anniversary coming up soon!) I use it at home, of course, but I also use it while travelling, and that’s the problem. Because when I’m in hotel rooms, it’s sooo annoying to have to switch whatever bluetooth speaker I’m using on, and then open the laptop, find Emacs, and press z (for unpause). And then when going out, it’s the same thing, only in reverse! This cannot stand! It’s an outrage!

So I thought… all these things have in common that they are events that I want to react to, but in my own way. What would be an easy way to detect these events?

Well, there’s Dbus.

dbus-monitor --system certainly says that there’s a lot of information passing over that bus, so perhaps that’s all I need?

So I looked at the Emacs Dbus documentation… and that sounds promising. And the documentation in my somewhat older Emacs says:

dbus-register-signal is a byte-compiled Lisp function in dbus.el.

(dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest
ARGS)

Register for a signal on the D-Bus BUS.

[...]

SERVICE, PATH, INTERFACE and SIGNAL can be nil.  This is
interpreted as a wildcard for the respective argument.

OK, and I just want (as a first step) just to see what data is available, so since all those things can be wildcards, this should work, right?

(defun my-signal-handler (device)
  (message "Device %s added" device))

(dbus-register-signal
 :system nil nil nil nil #'my-signal-handler)

But nope, total silence. And google shows me nothing, of course, because Google. I’ve been experimenting lately with using ChatGPT for somewhat vague questions like this, so I asked, and it gave me the same basic solution:

Which doesn’t work, either.

Now, I haven’t kept up with Emacs development, so I have no idea whether this has been fixed by now, but I looked at the source code in my Emacs, and:

Hey! The handlers are registered in a hash table! There’s no wildcarding for the interface and signal parameters!

And with that, I whipped up a little package (that you can find on Microsoft Github) that allows you to conveniently look at the Dbus properties that change:

Etc etc. And… tada! All the info for all my three problems is available!

So now 1) my laptops dims the screen when there’s 5% battery power left (livin’ on the edge), 2) switches off the screen when I close the lid, and 3) stops playing music when I switch off the bluetooth speaker (and switches the music back on again when I switch the speaker on).

Success! Everything is indeed possible if you have Emacs.

Now, the package on Microsoft Github can’t be used as is by anybody, because it’s so dependent on what your environment looks like. But I think it’s structured in a way that you can trivially tinker with it. So if you have any similar odd configuration issues (because you’ve got strange requirements), have at it.

May Music

Music I’ve bought in May.

So what have we got here…

Ai Aso’s new album is produced by Stephen O’Malley from Sunn O))), and in a way it makes sense… it’s like the quietest album ever? But it sounds like Sunn O))), only with the volume turned down to almost nothing.

John Lurie National Orchestra - If i sleep the plane will crash

And two albums by John Lurie, and they’re both fantastic.

Pet Shop Boys - Loneliness (Official Video)

I was extremely sceptical towards the new Pet Shop Boys album, but then I listened to it a number of times and now I… *gulp*… kinda like it?

Squarepusher - Enbounce [Dostrotime Listening Party Record]

Squarepusher’s new album is an 8 bit extravaganza.

And then there’s other stuff.

Comics Daze

Whattayouknow. I’ve got more comics, so today is a comics reading day.

Aaliyah: Aaliyah

13:45: Frenzy by Tetsunori Tawaraya (Desert Island)

This is a proper thick hardback book — I think this is the first I’ve seen from Desert Island? It reprints stuff previously published, though.

And this is a collection of illustrations, no narrative…

… and it’s totally wild.

Richard and Linda Thompson: Hard Luck Stories (8): Shoot Out The Lights

13:56: Goiter by Josh Pettinger (Floating World Comics)

And this is a collection of things previously published, too? I just flipped through it quick here, and bits seem familiar. Let’s read…

Wow, that’s a bizarre paper choice… it’s grey-bluish, which means that there’s reduced contrast between the black lines and the background. (But is it printed that way or is the paper actually bluish? I think it’s the former.) This, combined with the small size this is printed on makes it hard for these eyes to read the text here. And… it almost looks like it’s been printed from a low-res scan? Surely that’s not the case, but it looks like digital artefacts all over the place. It’s weird! Hm… the linework is so soft that it looks like it’s been digitally shrunk and smoothed… Perhaps they’re trying to replicate bad 50s comics printing and failing?

The paper is also the thinnest I’ve seen — it feels like oldee tymey phonebook paper — pretty smooth, but non-shiny and very very thing.

Anyway!

Oh, most of this I haven’t read before at all — is much of it new or something?

Gah. This was drawn for a different aspect ratio, and is reduced to a size where I can barely make out the lettering.

Well, OK — I can’t just bitch about the printing, can I? I guess much of the material here is pretty amusing, but it’s also relentlessly depressing.

Hah! I knew it! The paper is just printed in the background colour…

And this is totally illegible to me.

Neil Young: Archives Vol. II (7): Homegrown (1974-1975)

15:06: Bezimena by Nina Bunjevac (Fahrenheit)

Oh wow, looking at this after Goiter is like putting on glasses — suddenly everything is clear! *phew*

The artwork here is properly impressive.

The story is allegedly a riff on a Greek myth, but is mostly about rape and stuff? I think I can sum up the plot as “er, what?”

It’s a strange book. But very pretty.

15:25: Monster Fan Club #2 by Shaky Kane (Floating World Comics)

This is funny…

… but also intense. And things sort of connect, too, in various spooky ways. Great book.

Joni Mitchell: Archives: The Asylum Years (3)

15:39: Anna by Mia Oberländer (Fantagraphics)

I like the stark graphical quality of this book.

It’s about being a tall woman and the ensuing travails thereof. Which reminds me of an article I read a couple of days ago. The interesting bit is (they’re talking about the chance that a wife is taller than her husband):

It’s roughly 1 in 40 if you assumed non assortative mating (just randomly picked men and women from the respective height distribution of men and women).

And then they show that the real distribution is probably pretty close to 1 in 40 — so height doesn’t really make much difference in how heterosexual men and women chose their mates, contrary to all myths.

I thought that was pretty amusing, anyway.

I FEEL SEEN! (I’m 194cm. (That’s six feet four inches for you Imperials.))

But it’s an odd book — it’s like one long… complaint? It’s just hard to not roll your eyes in the general direction of this book, no matter how heartfelt the traumas within may have felt.

16:06: Forbidden Drawings (Desert Island)

Another Desert Island book, and this one is hefty, too — but stapled instead of hardcover, this time around.

This is a collection of sexual artwork — it’s mostly illustrations, but there’s a couple of comics.

The selection seems pretty random — there’s a number of old illustrations, but it’s mostly modern.

And mostly pretty bizarre.

And I guess two thirds are bondage related?

Hey, Joe Simon…

Anyway, it feels like a very… compulsive? book.

The John Lurie National Orchestra: The Invention of Animals

16:24: How Ware Begins by Igort (Fantagraphics)

I think this is Igort’s second book about Ukraine and the Russian horrors perpetrated against Ukraine, which is commendable. (What’s strange is that there aren’t more books like this, really, but then again comics take a long time to make.)

I’m not sure this book is totally successful, though, but that feels like nit-picking.

It’s a strong book, in any case.

A Certain Ratio: It All Comes Down to This

17:37: Den perfekte mor by Klara Nordin Stensö (Cobolt)

This is a book about giving birth…

… and then experiencing the pressure to breast-feed.

It’s inventively told and engaging.

Kim Gordon: The Collective

17:59: Blessed Be by Rick Altergott (Fantagraphics)

Parts of this were originally serialised in Raisin Pie a couple decades ago, but I think it’s been redone? It looks very consistent in this edition, at least, and not like it’s been drawn over decades.

And, yes, it’s impossible not to love Altergott’s Wally Wood via Rand Holmes artwork — it’s so much fun to look at. Altergott has a coarser line than those two, though, so it doesn’t look as inhumanely precise.

The storyline is more straightforward than I remembered (and way more straightforward than previous Doofus stories). The dialogue seems patterned after Mad Magazine movie parodies — each panel has a lot of conversational back and forth, so it takes a while to realise that the dialogue (while sometimes loopy) is straight — there’s few actual jokes here. (I mean, fewer than you’d expect.)

And the plot is, too: This could have been a 70s movie a la Jaws, only with satanists instead of a shark.

So it’s an odd book. It’s entertaining, but…

Squarepusher: Dostrotime

19:30: Tes yeux ont vu by Jérôme Dubois (Cornélius)

This is very pretty.

It’s a somewhat science fictional story about a scientist that creates a being, and then that being coming to terms with that, sort of. So not exactly a spanking new plot (*cough* Frankenstein on *cough*), but it’s done very well.

And it’s got all these little moments — yes, moments, of drama, but told in a kinetic, mesmerising way. It’s good stuff.

Sean Ono Lennon: Asterisms

20:06: Du snakker med feil person by Martin Ernstsen (Jippi forlag)

This is one of those there them autobio comics — it’s mostly funny anecdotes, but it does sort of build into a larger narrative.

And many of the strips are about being an autobio comic artist, which can get a bit claustrophobic, but it’s done very well.

Pet Shop Boys: Nonetheless (1)

And he’s not afraid of depicting himself as a slight buffoon, which helps a lot. It’s really good.

OK, perhaps I should call it a night…

Julia Holter: Something in the Room She Moves

21:38: Flickvänsprovet by Ditte Lindroth (Kartago)

But I’ve done comics in Danish, English, French and Norwegian, so I gotta do one in Swedish, right? Right!?

I guess this could also be autobio? Not sure. In any case, it’s about two 19-year-olds who decide to take the Trans-Siberian railroad… which I totally wanted to do as a teenager. I think it was more the idea of the extreme length of the trip more than anything that appealed?

Ai Aso: The Faintest Hit

I can’t say that the artwork much appeals to me, but the storytelling is on point, and it’s a pretty engrossing book on the whole.

Ai Aso: The Faintest Hit

22:10: The End

And that’s enough comics for one day, dontcha think? Right.