Score:3

Configuring keyboard with script to run at login

hm flag

There are two changes to the keyboard behaviour I want to implement: 1) setting CAPS LOCK to Control and 2) decreasing the time it takes for a character to be inserted once I press down a key.

I can achieve that by running the following commands on a terminal:

setxkbmap -layout us -option ctrl:nocaps
xset r rate 200 80

I'd like, however, to have these changes effective every time I log in without any extra action from my side.

I have tried adding the file to /etc/profile.d/keyboard_config.sh with the commands above. But it didn't work.

I also wouldn't like to download an extra tool only for that.

Is there a way I can accomplish that with only a script? I am using Ubuntu 20.04.

Score:4
ar flag

You can put your commands into a shell script, and have it started from a .desktop file under ~/.config/autostart.

Or click on "Activities" in the lower left corner, and search for "Startup Applications". There you can also add your script. (it's just an interface that will write a .desktop file into the autostart directory)

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.