I use Lubuntu 18.04.

I'm trying to assign my keypad delete key to em dash permanently.

AutoKey-GTK doesn't seem to be able to handle this for some reason.

The xmodmap command works, but I'm having difficulty getting it to execute at startup to make it permanent.

I've tried (all without success):

  • Adding em dash as a phrase in AutoKey-GTK
  • Adding the xmodmap command to the Lubuntu startup programs GUI
  • Adding the command to the above as a bash script.
  • Creating .Xinitrc and .Xmodmap files as described by another poster here.
  • Adding it to the default applications list with a 15 second execution delay.
  • Creating a desktop launcher and adding that to the 'autostart' folder.
  • Adding the command script to the crontab under @reboot and running every two minutes.

So far nothing has worked.

The command is simply:

xmodmap -e "keycode 91 = emdash"

Anybody have any suggestions?

  • 2
    Possible duplicate of "Startup Applications" not working – Jacob Vlijm Nov 1 '18 at 17:27
  • Tried that too. Also didn't work. I'm having one of those moments when you wonder why everything to do with Linux is so incredibly difficult! – Daniel R Nov 1 '18 at 17:54
  • Pretty sure it is a timing issue if the command works once all is fully started up & loaded. In some extreme cases (vm?) The 15 sec. isn't enough. Start with 30 or 40 seconds, making it shorter until it breaks. – Jacob Vlijm Nov 1 '18 at 18:00
  • Tried 30 and 40 seconds. Still no success. This is very mysterious. I'm tempted to just give up! – Daniel R Nov 1 '18 at 19:25
  • Line I'm trying in Lxsession: imgur.com/a/nikkxc0 Contents of script: #!/bin/bash xmodmap -e "keycode 91 = emdash" exit – Daniel R Nov 1 '18 at 19:27

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.