hhmx.de
zirias@snac.bsd.cafe
zirias@snac.bsd.cafe

zirias (on snac)

(@zirias@snac.bsd.cafe)

Di 01.10.2024

Beiträge: 32Folgt: 0Folgende: 0

Dipl.inform., FreeBSD ports committer, musician, C64 fan/coder, hetero cis white male, not proud, no wing, no ally, leaning liberal/ecologist, pro facts/science

Föderation · So 13.10.2024 08:25:56

After implementing " awareness" (calculate resolution of the primary screen and use this for patterns) in , I was unhappy with the (correct) result: Everything too large for my taste. I also added a resource dpi to override the calculated resolution, setting this to 72 gave me the previous results, but it's logically wrong.

I now did a different thing to solve this: Give the Font resource (the class name for fonts other than the emoji font) extra semantics. Xmoji now checks explicitly whether a resource for this class is set, and, if so, considers that value the "default system font", basing all sizes on that.

Now I can just add Xmoji*Font: sans-10 to my .Xresources and get the looks I like with all other settings left at their default on my 96dpi display. ๐Ÿฅณ

If you have any objections or run into unexpected behavior testing this, please let me know. I'd like to release Xmoji 0.9 "soon". ๐Ÿ˜Ž

Xmoji with system font "sans-10" in a german locale on a 96dpi display

(Medien: 1)

Föderation · Sa 12.10.2024 07:56:58

Someone mentioned they liked the little "" that grew inside of ๐Ÿ˜‰ ...

This gave me the idea I should attempt to document it somehow. If only for my later self ๐Ÿ˜Ž. First step: Try to create some visualization. Here's a very early draft of a "class diagram" created with โ€“ so far showing only "is-a" () relationships. I hope I can add edges there keeping it still readable, we will see... ๐Ÿค”

And then, it will of course need quite some text explaining how things work together.

CC: @kaveman@bsd.cafe


Xmoji toolkit class diagram, first draft

(Medien: 1)

Föderation · Do 10.10.2024 16:01:12

It just came to my mind that another thing should probably go on the V1.0 roadmap for : A . But then, this reminds me of doubts I had ever so often: should have a single source of truth (otherwise it will go out of sync eventually).

I could just declare that's the manpage now, which would mean to remove everything I put there from the README.md. Not ideal though, this markdown file is accessible for direct reading on github (and would be on other "hosted git" solutions), while it's still well readable as plain text. This certainly isn't true for some roff-like markup. ๐Ÿ˜ž There's the additional problem of which markup flavor to choose: the modern mandoc (which is native on ), or the classic troff man macro package (which still seems "native" in 's man-db)... Modern installations support both flavors, but conversions aren't "perfect".

There are also many "document generators" around that typically allow output as html, pdf, man, ... but I didn't find one so far that really gave satisfactory results for man. A while ago, I wrote my own tool which can generate source for "help" output, man (in both flavors) and html, and this worked pretty nicely, but the key was a very limited scope, it only supports a few sections (general description, options, environment variables) and only options in the classic style (single letter, collapsible). So, it wouldn't fit the bill for Xmoji.

Great ideas anyone? ๐Ÿ˜

Föderation · Do 10.10.2024 08:29:52

I just added an important piece of to 's README.md: the commandline arguments. No idea how I could forget about documenting that so far ๐Ÿ™ˆ

(Note the -class and -f options aren't implemented in Xmoji 0.8 yet)


Commandline arguments of Xmoji

(Medien: 1)

Föderation · Mi 09.10.2024 20:51:04

... one thing I learned from bad experience is to never rush a release.

I just fixed a very stupid bug I introduced in while changing all the config file handling to work fully asyncยน (simulated using a threadpool). There was a code path attempting to call fclose() on NULL. As a result, Xmoji didn't work any more if there wasn't a config file yet.

I didn't notice for two days straight, because I have my config file on my machine ... ๐Ÿ™ˆ

These things happen, and if you don't want to release something with really silly bugs, give it some time ๐Ÿ˜‰ ... and btw, I'd appreciate some testing done not by me, you know, different environment, different user expectations, this helps discovering more bugs!

Xmoji 0.9 will be there soon, I hope this time not too soon ๐Ÿ˜

ยน I remember mentioning in some previous toot asking for help with testing that this was an intrusive change needing proper testing. Guess that's also experience ๐Ÿคท๐Ÿ˜œ

Föderation · Mi 09.10.2024 15:53:01



So, you want to launch some external tool. Ok, fork()/exec() is simple enough.

But you don't want to "care" for it (wait()) if it's running longer. Ok, just fork some intermediate child, init will adopt it when this child exits.

But wait ... you do want to know if execution itself fails ... or if the tool exits "somewhat quickly" with an error. Okay, this will be interesting ...

Seriously, I'm quite unsure whether this code here is correct. But it's surprisingly large for that "simple" job.
https://github.com/Zirias/xmoji/blob/master/src/bin/xmoji/xdgopen.c#L56

Föderation · Mi 09.10.2024 13:24:26

I like concise documentation ๐Ÿ˜


sigwaitinfo(2) - STANDARDS: POSIX.1-2008. HISTORY: POSIX.1-2001.

(Medien: 1)

Föderation · Di 08.10.2024 20:21:31

Finally fixed the annoying little build system bug in . Now, the internal libdir is always appended to LDFLAGS (non-overridable).

Just for fun, I once wanted to see how the build log grew ๐Ÿ™ˆ ... made it easy to get a screenshot ๐Ÿ˜


Full build log (non-verbose) of Xmoji

(Medien: 1)

Föderation · Di 08.10.2024 16:35:57

Call for testing... 0.9 to be released soon!

The major thing still missing from my roadmap to V1.0 is the tray icon, but I think it makes sense to have yet another 0.x release first.

0.9 will bring you a single instance mode (on by default, but can be turned off). This is expected to be especially useful if you have some key binding to launch Xmoji. If it's already running, you'll just get the running instance on top of your current (virtual) desktop!

I also modified my code handling the configuration file to prefer "async" operation (simulated using a thread pool), so it should never stall the GUI. This is a pretty intrusive change, therefore it should be tested for a while before releasing. That's where you can easily help, build/install it from github and if you find something, please open an issue, thank you ๐Ÿคฉ:
https://github.com/Zirias/xmoji/issues

I'd also love to add more translations ... gentle hint:
https://github.com/Zirias/xmoji/blob/master/TRANSLATE.md

All in all, this is really a fun project for me, I very much enjoy doing it in . I keep learning new things, and at the same time, really understanding the logic of your own code down to the API and/or protocol layer often gives opportunities to come up with the best solutions for a certain problem.

Here's my "development environment" btw: xterm, tmux, zsh, git, vim. ๐Ÿ˜


Checking the main source directory of Xmoji ....

(Medien: 1)

Föderation · Di 08.10.2024 11:31:34

Having my $HOME on , I'm sometimes annoyed by lots of applications "freezing" when there's some issue with the NFS server. I just decided I'll try to prevent this in .

Now, how to do that? Nonblocking mode (which I use for sockets etc) doesn't do anything for regular files, they're always "ready to read/write". Still, actually reading or writing might block your thread. Then there's . From what I found, this has issues in real implementations, e.g. uses kernel workers for implementing it, which are limited, and also doesn't even allow it on NFS by default, because it could cause deadlocks. Looking at the side, there seems to be some platform-specific async I/O implementation in the kernel, but implements the POSIX aio entirely in userspace... ๐Ÿคฏ

Ok, screw all that. I'll do the simple thing and use worker for file I/O calls, should be somewhat easy as I already have a "threadpool" in . I just started doing that in my "filewatcher" in case it needs to use stat():
https://github.com/Zirias/xmoji/commit/8ba637c482e82791c9e20db21ce95a3e854b6f86

More to follow ... ๐Ÿ˜‰