macOS-style press-and-hold accents on GNOME – prototype using IBus

Hi,
I use a US keyboard and often write in Italian. One small macOS feature I really miss on Linux is being able to hold a key and get è é ê ë....

So I tried to reproduce it on GNOME using IBus:

github.com/manux81/gnome-accent-hold

It works quite well now: normal typing stays immediate, while holding a letter opens a small popup to choose the accented character.

I’m mostly posting this because I’d like some feedback from people who know GNOME/IBus better than me. Does IBus look like the right place to implement something like this? And is there anything I should do differently, especially with Wayland?

Thanks!

It would be nice (if possible in the design) to account for atomic/immutable systems, I personally can’t test this due to using Fedora Silverblue, since the installation script touches on /usr files.

Thanks, that’s a very good point.

Looking at the installer again, the engine itself is already installed per-user under ~/.local/libexec, but I currently install the IBus component XML into /usr/share/ibus/component, mainly because that was the most reliable way I found to get IBus to discover it during the prototype phase.

There shouldn’t really be a need for Accent Hold to modify /usr, though. I’m going to change the installer to support a fully user-local installation, including the IBus component, so that it also works cleanly on Silverblue/other immutable systems without sudo.

I may need to take a bit of care around IBus component discovery/cache when using a user-local path, but this defi

nitely looks like the better design.

Thanks for pointing it out — Silverblue is actually a very useful test case for this.

21:45

Quick update: the installer is now fully user-local.

Both the engine and the IBus component are installed under ~/.local, so it no longer writes to /usr or requires sudo. The installer also refreshes the IBus registry cache.

The change is available here:

I haven’t tested it on Silverblue yet, so any feedback would be very welcome. Thanks again for pointing this out!

Gave it a quick shot once again and, although it now installs and can be used, it isn’t working for me currently. If I press and hold the button, the popup shows up, but typing on the numbers to select one of the options doesn’t work and clicking one of them doesn’t replace the letter with the selected variant.

Another minor gripe is that the popup window, unlike the default typing-booster, conflicts a bit with MosaicWM, changing the window layout while it’s open.

I’ve pushed another update that removes that window entirely and now uses the native IBus.LookupTable candidate UI instead. This means the popup is rendered by the IBus/GNOME Shell panel rather than being a normal application window, so it should no longer interfere with MosaicWM or change the window layout.

To make sure you are testing the latest version, you can remove the current installation and reinstall from main:

cd gnome-accent-hold
./uninstall.sh

git pull
./install.sh

Then restart IBus or log out and back in before testing again.

Now it works perfectly for me! Great work!