3

I'm trying to run this in my /etc/init.d/rc.local. I had to manually add the exit 0 because it wasn't there by default if that makes any difference.

cd /home/john/xcape && ./xcape -e 'Control_L=Escape'
exit 0

So to check if it works, I run this, and it returns..

$ sudo service rc.local start
Unable to connect to X11 display. Is $DISPLAY set?

Yes, it is set.

$ echo $DISPLAY
john-Ubuntu:0

I went through this tutorial http://pic.dhe.ibm.com/infocenter/hatshelp/v80/index.jsp?topic=%2Fcom.ibm.hats.doc%2Fdoc%2Fudispenv.htm

I looked around on AskUbuntu and they all seem to point to this same step.

  • 2
    The commands go in /etc/rc.local, /etc/init.d/rc.local is the service for running that file. And Upstart controls the environment that it is run in: http://askubuntu.com/questions/2075/whats-the-difference-between-service-and-etc-init-d/47664#47664. Lastly, a GUI command shouldn't go in rc.local, it's run too early. Try ~/.profile or ~/.xsessionrc, since this is for your user.. – muru Nov 01 '14 at 19:57
  • 1
    In addition "./xcape" is ambiguous , use the full path in scripts. – Panther Nov 01 '14 at 20:13
  • I tried adding the cd /home/john/xcape && ./xcape -e 'Control_L=Escape' exit 0 to the ~/.xsessionrc and now when I login to the computer, it ignores my password and asks for it again. I can't get into my computer now. – John Curry Nov 01 '14 at 21:31
  • 1
    Thank you, got it to work. I am trying to accept your answer, but it doesn't look like I'm able to, nor can I upvote it because my reputation is too low, but thank you. the problem was the exit 0. Once I got rid of that it started working. – John Curry Nov 02 '14 at 21:44

0 Answers0