VirtualBox – No backlight on CMSTORM keyboard

cmstorm keyboard

This article shows you how to enable the backlight feature (Screen Lock key) on a CMSTORM keyboard.

Environment

  1. VirtualBox 5.1.14
  2. Ubuntu 16

1. Solution – Quick

To fix it quickly, run the following command in a terminal, and press the “Screen Lock key” again, the backlight should be enabled.

Terminal

$ xmodmap -e 'add mod3 = Scroll_Lock'
Note
If the VM is restarted, you need to issue the same command again!

2. Solution – Shell Script + Auto Start

The permanent solution is creating a shell script and set its auto start.

2.1 Create a shell script, and put the following content:

/home/mkyong/scripts/backlight.sh

#!/bin/bash
sleep 1
xmodmap -e 'add mod3 = Scroll_Lock'
xset led 3

2.2 Make above shell script executable – chmod +x backlight.sh

Terminal

$ ls -lsah
total 12K
4.0K drwxr-xr-x  2 mkyong mkyong 4.0K Feb   5 10:24 .
4.0K drwxr-xr-x 17 mkyong mkyong 4.0K Feb   5 10:24 ..
4.0K -rw-r--r--  1 mkyong mkyong   67 Feb   5 10:24 backlight.sh

$ chmod +x backlight.sh 

$ ls -lsah
total 12K
4.0K drwxr-xr-x  2 mkyong mkyong 4.0K Feb   5 10:24 .
4.0K drwxr-xr-x 17 mkyong mkyong 4.0K Feb   5 10:24 ..
4.0K -rwxr-xr-x  1 mkyong mkyong   67 Feb   5 10:24 backlight.sh

2.3 Create a /etc/xdg/autostart/backlight.desktop file and set the above shell script auto start.

Terminal

$ sudo vim /etc/xdg/autostart/backlight.desktop
/etc/xdg/autostart/backlight.desktop

[Desktop Entry]
Type=Application
Name=Devastator Keyboard Backlight
Exec=/home/mkyong/scripts/backlight.sh
X-GNOME-Autostart-enabled=true

Done. Restart VM.

References

  1. Xmodmap example
  2. xmodmap Hints and Tips

About the Author

author image
mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.

Comments

Leave a Reply

avatar