I had a problem with Caps and I've got a script to fix this. Unfortunately, this script works until reboot:
# Fix caps
xkbcomp -xkb "$DISPLAY" - | sed 's#key <CAPS>.*#key <CAPS> {\
repeat=no,\
type[group1]="ALPHABETIC",\
symbols[group1]=[ Caps_Lock, Caps_Lock],\
actions[group1]=[ LockMods(modifiers=Lock),\
Private(type=3,data[0]=1,data[1]=3,data[2]=3)]\
};\
#' | xkbcomp -w 0 - "$DISPLAY"
exit 0
I would just add it into startup applications, but I'd like to run it on LightDM startup, or even at X11 start. Is there any way to run this script on X11 startup? I'm using Xubuntu 16.04.2.
Thanks.
Best Answer
Try the following:
Place your script into a system-wide directory such as /usr/local/bin with an appropriate shebang
Make it executable e.g.
sudo chmod +x /usr/local/bin/fix-caps.sh
Create a custom config file in
/etc/lightdm/lightdm.conf.d
. Use a name such as99-local-settings.conf
. (The99
prefix means that it will be run after the standard setup scripts provided in/usr/share/lightdm/lightdm.conf.d
.)Add the location of your script as a
display-setup-script
int the[SeatDefaults]
section:The
display-setup-script
should be run after the X server is started, but before any greeter is run - see LightDM: Adding system hooks.