1

I'm having a problem that I don't know what else to do. I've created a simple one command shell script with the following lines:

#!/bin/bash
xmodmap -e 'add mod3 = Scroll_Lock'

I've given execute permission to it using:

sudo chmod a+x scr.sh

If I run it from the terminal, it runs. No errors. BUT if I put it on Startup it won't run on auto. I have a CMDevastator keyboard and trying this script to turn on the keyboard LED.

Zanna
  • 70,465

2 Answers2

1

You can add your script to /etc/rc.local, make sure you provide full path to your script before exit 0. Anything written after exit 0 will never be executed.

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
sh /path/to/your/script.sh
exit 0
derHugo
  • 3,356
  • 5
  • 31
  • 51
Liso
  • 15,377
  • 3
  • 51
  • 80
1

Use Cronjobs Using crontab -e And @reboot Or Use /etc/rc.local