2

i'm buy a mechanical keyboard for my computer, i'm using kali linux rolling 2016.2 i'm forget to read the compatible driver for my keyboard.and that's only compatible in windows 10 and mac. after i'm searching "how to enable backlit keyboard on linux" i found the answer. he said i shoul run on terminal "sudo xset led 3" and its work, but i dont know how to turn off it again. my question is, how to turn on the backlit using key"schroll lock" and that's command is same with running "sudo xset led 3" in terminal.

1 Answer 1

6

LED ON

sudo xset led 3

LED OFF

sudo xset -led 3

A script to toggle LED On/Off with the "Scroll Lock" key:

#!/bin/bash
on=$(xset -q | grep 'Scroll Lock:' | cut -d ":" -f 7)
echo $on
if [ $on == "off" ]; then
   xset led named "Scroll Lock"
else
   xset -led named "Scroll Lock"
fi  

Save it and bind to a key with a shortcut.

Sources:

xset Man page: ftp://www.x.org/pub/X11R7.5/doc/man/man1/xset.1.html

Forums: http://www.forosuse.org/forosuse/showthread.php?t=33563

1
  • 1
    Doesn't work on Linux Mint 19.1.
    – falconR
    Dec 28, 2018 at 0:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.