0

I am trying to run

setxkbmap -option caps:escape 

in my rc.local file under /etc/init.d/ in Kubuntu 15.04, and no matter where I put it, beginning or end, or with exec in front of it, it is not running. Basically, I want to be able to run gvim with caps as escape, and I don't really want to put this into .bashrc as that will run every time I open a terminal (unnecessary) and also I would like to be able to run gvim without first opening bash, and still having caps as escape.

This command works fine in the command line.

The whole rc.local looks like this:

#! /bin/sh
### BEGIN INIT INFO
# Provides:          rc.local
# Required-Start:    $all
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:
# Short-Description: Run /etc/rc.local if it exist
### END INIT INFO


/usr/bin/setxkbmap -option caps:escape
PATH=/sbin:/usr/sbin:/bin:/usr/bin

. /lib/init/vars.sh
. /lib/lsb/init-functions

do_start() {
       if [ -x /etc/rc.local ]; then
               [ "$VERBOSE" != no ] && log_begin_msg 
"Running local boot scripts (/etc/rc.local)"
               /etc/rc.local
               ES=$?
               [ "$VERBOSE" != no ] && log_end_msg 
$ES
               return $ES
       fi
}

case "$1" in
   start)
       do_start
       ;;
   restart|reload|force-reload)
       echo "Error: argument '$1' not supported" >&2
       exit 3
       ;;
   stop)
       ;;
   *)
       echo "Usage: $0 start|stop" >&2
       exit 3
       ;;
esac

Am I doing something wrong? Anything else to do to get the same result? I am not running Unity so compizconfig won't work.

1

Don't think that it is useful to run any programs with 'x' in their names before the actual X GUI session is started.

Put it into 'Startup Applications' (or whatever it's called in KDE).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.