- Create the following three files:
/etc/systemd/system/caps-to-ctrl.service
[Service]
ExecStart=/usr/local/bin/caps-to-ctrl.sh
[Install]
WantedBy=default.target
/usr/local/bin/caps-to-ctrl.sh
#!/bin/bash
setxkbmap -option caps:ctrl_modifier
/lib/systemd/system-sleep/caps-to-ctrl
#!/bin/bash
case "$1" in
post)
setxkbmap -option caps:ctrl_modifier;;
esac
- Set appropriate permissions and install service
chmod 744 /usr/local/bin/caps-to-ctrl.sh
chmod 664 /etc/systemd/system/caps-to-ctrl.service
chmod 755 /usr/lib/systemd/system-sleep/caps-to-ctrl
systemctl daemon-reload
systemctl enable caps-to-ctrl.service