Just started work on the planned "single instance mode" for #Xmoji.

The first commit is done, adding a class implementing the core functionality using a local #Unix #socket. Part of the job is deriving a unique name for that socket, where #hashing comes natural.

I had a similar class in #qXmoji (based on #Qt), and there you have #sha256 at your fingertips with QCryptographicHash, so I just used that. You need a string from that, and sure thing, there's a .toBase64() method. Well, a / doesn't play well for filenames, but then, there's .replace().

Without all these helpers from Qt, first thing I did now was searching the web for a "good" hash function, but there's certainly no need for a cryptographic one. I found #FNV1a. It's super easy to implement in #C. And for the base64 part, well, doing it myself, I can directly use a modified set of digits, without the /.

Now, here's the whole thing:
https://github.com/Zirias/xmoji/commit/db764e3184537d42b528e718bd4886495eb45544

I'd say that's a nice example how not having lots of "powerful" library functions readily available can lead to a much better (smaller, more efficient) solution. 😏

#X11 #emoji #keyboard #development
SingleInstance: Enforce single running instance · Zirias/xmoji@db764e3

Add class to optionally enforce a single running instance per host and user. Use this during xmoji startup().

GitHub
Ah, nice. I just deprecated #qXmoji, now that #Xmoji has all the "important" features (and more). Didn't even know someone packaged it for AUR.

In general, I've seen very mixed quality in AUR, unfortunately. If #Xmoji appears there, I should notice (thanks to #repology) and review what was done 😁

This is now kind of a dev microblog concerning #Xmoji. I'm kind of stalled, now that version 0.7 seems reasonably stable and portable (I see there's a #nix pkg, unfortunately outdated, and a #NetBSD #pkgsrc port, I will deliver #FreeBSD *soon*).

It misses a few convenience features my previous #qXmoji had: save/restore the window size, optionally enforce a single instance, offer a #tray icon. I'll add all of that, seems straight-forward, for the tray icon I'll only implement the old #X11 spec based on #Xembed and if some desktop environment insists on only supporting the newer standard based on #dbus, well, screw that. Too much complexity, sorry.

The real issue is #localization (#l10n), specifically "just" translations. I still have no good concept for that. With #Qt, it was a no-brainer to also use Qt's mechanism. Without a toolkit, obvious choices would be either #POSIX message catalogs, or #GNU #gettext. The latter is much more convenient, but pulls in extra deps (with #GPL/#LGPL foo). Both have in common that they only operate on char* ... 8bit encodings. I have many of my texts stored as char32_t (#Unicode UCS-4 or #UTF32, difference doesn't matter much here). I could redesign that to base everything on #UTF8, but I'm a bit reluctant ... why add more runtime conversions?

I seriously think about coming up with my own tooling. But then, how far should I jump? Should I really try to parse my own source (using LLVM's #libclang for example)? Or should I hardcode tables with identifiers for all translatable texts?

I'll sleep on that a few more nights I guess....

#X11 #emoji #keyboard

Comparing dependencies, transitive/complete and direct, for #Xmoji and #qXmoji.

Xmoji results in a somewhat larger binary, has more direct dependencies, but a smaller full dependency tree, therefore less code in total 😎

Working on the first #emoji #keyboard feature I did *not* implement in #qXmoji, testing the first working implementation:

Grouping emojis over skin-tone variants, using a "fly-out" style menu to pick the variant. The fly-out is opened with the right mouse button (because I hate this "long-press" stuff that's used a lot) and closes as soon as the mouse pointer leaves it. It supports both methods (left-click to fake key-press events, middle-click to select) just like in the main window.

Still missing: Align it to the "parent" emoji button if possible, and draw an indicator in the parent button that there *is* a fly-out available.

#X11 #xcb #programming

I'm amazed to find quite a few people on here still very interested (and, active) with #X11! 😎 I just started exploring #xcb for #programming an X client, and have fun with that. No, X ist NOT dead❗ (But maybe a new major version, like X12, could be a good idea, dropping lots of stuff not useful anymore nowadays, like all the core drawing/fonts, like COMPOUND_TEXT, and so on ...)

My goal is to create

... the "perfect" #emoji #keyboard for X.

All existing projects I found either depend on a specific GUI toolkit or at least some "input method", or are just broken... I already created "#qXmoji": https://github.com/Zirias/qxmoji -- works, but shows suprising lags initializing GUI elements (> 3500 emoji buttons). It needs some native xcb code already, so I had the crazy idea to do it completely without any toolkit.

For now, I'm just building generic "widgets". Next is probably a "Tab Set"; with buttons and a scroll area, all the required building blocks are available. I'll first try to have the features of qXmoji complete. That means one method for "emoji input": Send them as faked keyboard events. This needs ugly trickery, but works with any X client accepting keyboard input.

Maybe I can improve that later by also allowing other methods (selections and #XDnd) 🙃

I guess I won't try to implement #XIM though. It's not only somewhat complex, but also requires other clients to be XIM aware to work correctly, so the cost/benefit ratio might not be optimal 🤔

Work in progress is here (still far from doing anything useful):
https://github.com/Zirias/xmoji

GitHub - Zirias/qxmoji: Barebones X11 emoji keyboard with Qt GUI

Barebones X11 emoji keyboard with Qt GUI. Contribute to Zirias/qxmoji development by creating an account on GitHub.

GitHub

Let's start with my most recent opensource dev-project:

#qXmoji is an #X11 #emoji #keyboard. Although it uses #Qt for its GUI, the mechanism to "type" emojis is pure X11. This means any X11 client can receive them (whether that client can correctly *display* them is an entirely different issue 🙈) ... not even #XIM awarenesss is needed.

The mechanism to inject fake "emoji keyboard events" is quite hacky and dirty, but it works!

https://github.com/Zirias/qxmoji

Not sure whether I should add it to #FreeBSD ports, but if you want to try it, here's a patch for the ports tree:
https://people.freebsd.org/~zirias/patches/0001-x11-qxmoji-Add-new-port.patch

GitHub - Zirias/qxmoji: Barebones X11 emoji keyboard with Qt GUI

Barebones X11 emoji keyboard with Qt GUI. Contribute to Zirias/qxmoji development by creating an account on GitHub.

GitHub

Ok, I couldn't resist any more. Here's #French #qXmoji. Or, something like that ...? 🙈

Dear native-speakers, if I messed up TOO badly, help me out and send patches / pull requests 🤣🍻

(edit: ah great, I directly spot the first typo in this screenshot ... gonna fix immediately. Still, the hardest thing is to express technical things in french, I guess that counts as "domain specific language" and I really have NO idea how to do it)

#X11 #emoji #keyboard

I have one little piece of custom platform-specific code in #qXmoji.

Background is that #Qt's QFileSystemWatcher doesn't work correctly on #NFS (and probably other network filesystems). It uses some platform mechanism (e.g. inotify on #Linux, kqueue on #FreeBSD) internally, so exact behavior probably depends on the platform. On FreeBSD, it *seemed* to work, but only when the change to the file on NFS is done from the local machine. 🙄

Now regarding this code:
https://github.com/Zirias/qxmoji/blob/master/src/bin/qxmoji/nfsdetect.c
-- I still have doubts.

▪ Should it check for other filesystems as well? Which ones?
▪ Will this construct checking for 'BSD4_4' in <sys/param.h> reliably detect every OS derived from 4.4BSD (assuming a POSIXy system that *has* sys/param.h)?
▪ Should it have implementations for *other* POSIXy systems than 4.4BSD-descendants and Linux?
▪ Why the hell is there no standard for checking the *filesystem* a file resides on? 🧐😁

qxmoji/src/bin/qxmoji/nfsdetect.c at master · Zirias/qxmoji

Barebones X11 emoji keyboard with Qt GUI. Contribute to Zirias/qxmoji development by creating an account on GitHub.

GitHub

#qXmoji v0.7 released!

https://github.com/Zirias/qxmoji/releases/tag/v0.7

This brings several improvements, mainly in the build system, but the major change is support for localization, with translated Emoji names imported from #Unicode #CLDR. I added a German translation, see screenshot. Once again, I'd appreciate more translations, the process to translate is documented here:
https://github.com/Zirias/qxmoji/blob/master/TRANSLATE.md

Updated FreeBSD port:
https://people.freebsd.org/~zirias/patches/0001-x11-qxmoji-Add-new-port.patch

#X11 #emoji #keyboard #FreeBSD #Linux

Release qxmoji-0.7 · Zirias/qxmoji

Make everything translatable, add a document how to translate Add support to import emoji translations from Unicode CLDR files Translate to German Many improvements to the build system

GitHub