How to make xmodmap changes permanent?
14,888
Reboot
On the setting panel (KDE/GNOME) there is a startup section where application can be added to startup session, xmodmap can be added there
Resume
Xmodmap does not keep the changes after sleep/resume, here is how to set xmodmap on system resume with systemd: (non systemd user can use this)
-
Create xkeyboard resume script:
touch /usr/lib/systemd/system-sleep/xkeyboard; chmod 755 /usr/lib/systemd/system-sleep/xkeyboard
-
Edit xkeyboard and fill it with:
#!/bin/bash
case $1 in
pre)
exit 0
;;
post)
export DISPLAY=:0
sleep 10
xmodmap -e 'keycode 133 = F14'
;;
esac
Related videos on Youtube
Author by
intika
Let's make the internet libre https://linuxhacks.org/
Updated on September 18, 2022Comments
-
intika over 1 year
Using
xmodmap
to remap meta key with the following command:xmodmap -e 'keycode 133 = F14'
How can i make the change permanent, especially on system sleep, resume and reboot?
-
Codebling over 4 yearsCan you explain why
export DISPLAY=:0
andsleep 10
? -
Codebling over 4 yearsThanks! I ran into a few of those issues myself. In the end I wasted a bunch of time and could not get it to work.
-
NeilG over 2 yearsWhat about when the keyboard itself disconnects? I have a bluetooth keyboard that "goes to sleep" on an idle time out presumably, and when it comes back, the xmodmap mapping is gone. I'm manually re-applying it at the moment.