I have a script that remaps escape to caps lock. I normally call the script manually with
.Xmodmap is a file that contains:
remove Lock = Caps_Lock keysym Escape = Caps_Lock keysym Caps_Lock = Escape add Lock = Caps_Lock
I want this command to run at boot. What I did is go to /etc/systemd/system and create a file called "startup.service" with this contents:
[Unit] Description=Startup Applications [Service] Type=oneshot RemainAfterExit=false ExecStart=/home/myusername/scripts/.qs [Install] WantedBy=multi-user.target
.qs is a script with -rwxr-xr-x permissions with contents:
#!/bin/bash /usr/bin/xmodmap /home/myusername/.Xmodmap; rm /home/myusername/stop_time; date +%D' '%T > /home/myusername/stop_time
I enable the command by typing systemctl enable startup (not startup.service).
Here's the funny thing. The second and third command work fine on a new boot, the first one does not. It seems to execute the command or skip it somehow. The command works fine when executed in a terminal window. What am I missing here?