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.

2
  • I'm having the same problem, I was going to ask a similar question now. :/ Dec 1, 2016 at 11:17
  • Hi Marcos, it's a timing issue. See the linked dup. Dec 1, 2016 at 14:17

2 Answers 2

1

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

2
  • This will fail by definition, since this will be overwritten by local procedures. Dec 1, 2016 at 14:15
  • I don't wanna use any thirdy softwares, but I'll take a look to it. I'm new in linux world. Thanks for all the help! Dec 2, 2016 at 11:23
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
3
  • This will fail by definition, since this will be overwritten by local procedures. Dec 1, 2016 at 14:15
  • I'll try asap!. Dec 2, 2016 at 11:22
  • This post has flagged as duplicate, please try the linked answer instead.
    – Liso
    Dec 2, 2016 at 11:30

Not the answer you're looking for? Browse other questions tagged .