Running a bash process on startup in ubuntu

Ubuntu has a place called “Startup Applications Preferences” which is one way to organise something that runs upon startup. It is found by typing its name in the searchy thingy I don’t know the name of, and is a bit GUIish.

Because I use a Kinesis Advantage keyboard, I wanted to automatically swap the roles of the Tab and Delete keys upon startup. Here I record how to do this.

In the aforementioned “Startup Applications Preferences”, I create a new process, with the command section filled in with

bash .xmodstartup

It remains to create a file called .xmodstartup in my home directory, which I populate with the following xmodmap commands

xmodmap -e 'keycode 119 = Tab ISO_Left_Tab'
xmodmap -e 'keycode 23 = Delete NoSymbol'

And voila, upon startup, the Tab and Delete keys are switched.

If I ever want to undo this, and return to the default keyboard layout, this can be accomplished with running the following in a terminal

setxkbmap -layout us

This blog post exists to help my future self solve the same problem when I forget, and hopefully may help others who stumble upon it while searching the web to try and solve the same problem as me.

Now, next thing to do is to understand how to make the Windows/Super key behave exactly as I want it.

Leave a Reply

Your email address will not be published. Required fields are marked *