0

I put the the following in /etc/rc.local, to enable the Scroll Lock LED on my keyboard - it doesn't seem to take effect:

#!/bin/bash

enable scroll lock LED

xmodmap -e 'add mod3 = Scroll_Lock'

exit 0

I did do sudo chmod a+x /etc/rc.local to make it executable, and the script seems to work OK (makes the Scroll Lock LED work) when I execute /etc/rc.local from the terminal.

I know there are other ways to get scripts to run on boot, but I want to understand why this doesn't work.

nerdfever.com
  • 203
  • 2
  • 12

1 Answers1

1

This command won't work for two reasons:

  1. You need to use full path to xmodmap.

  2. The command needs a user session, that is not started yet when rc.local is executed.

You an add the command to "Startup Applications".

Pilot6
  • 90,100
  • 91
  • 213
  • 324
  • That works - thanks!. For those who want to know how to do it from the command line, "Startup Applications" creates a .desktop folder in "~/.config/autostart". – nerdfever.com Feb 06 '23 at 18:54