System: Slackware Linux (version 15.0)
CPUs: Intel(R) Core(TM) i5-3230M CPU @2.60GHz
GPU: Mesa DRI Intel(R) HD Graphics 4000
Deps: xcape-1.2.tar.gz
A. Olsson's xcape.
https://github.com/varehus/xcape
xcape-1.2.tar.gz
xcape.tar.gz
bash-5.1# installpkg --terse xcape-1.2-x86_64-1_SBo.tgz
xcape-1.2-x86_64-1_SBo: Linux utility to configure modifier keys .................. [ 80K]
bash-5.1#
Tap Left Alt, type c, then type u to render ∪.
bash-5.1$ cat ~/.XCompose
include "%L"
<Multi_key> <minus> <greater> : "→"
<Multi_key> <m> <o> : "∈"
<Multi_key> <c> <u> : "∪"
bash-5.1$ cat ~/.Xmodmap
keycode 248 = Multi_key Multi_key Multi_key Multi_key Multi_key Multi_key
bash-5.1$ diff -u /etc/X11/xinit/xinitrc.kde ~/.xinitrc
--- /etc/X11/xinit/xinitrc.kde 2024-08-27 20:55:53.000000000 +0200
+++ /home/eric/.xinitrc 2026-07-12 19:36:39.636443127 +0200
@@ -5,6 +5,7 @@
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
+userprofile=$HOME/.xprofile
# merge in defaults and keymaps
@@ -24,6 +25,10 @@
xmodmap $usermodmap
fi
+if [ -f $userprofile ]; then
+ . $userprofile
+fi
+
# Start the window manager:
if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
ck-launch-session dbus-launch --sh-syntax --exit-with-session startplasma-x11
bash-5.1$ cat ~/.xprofile
if command -v xcape >/dev/null 2>&1; then
xcape -e 'Alt_L=0x0000ff20'
fi
bash-5.1$ grep -E '2192|2208|222A' /usr/local/plan9/lib/keyboard
2192 -> → right arrow
2208 mo ∈ element of
222A cu ∪ union
bash-5.1$ man xcape | sed -n '4s/^[^-]*-\s*//p'
use a modifier key as another key
bash-5.1$
For GTK applications inject variables via a .desktop file.
bash-5.1$ grep xim ~/.local/share/applications/org.gnome.Epiphany.desktop
Exec=env GTK_IM_MODULE="xim" XMODIFIERS="@im=xim" epiphany %U
bash-5.1$
GNOME users need to deal with ibus.