Yesterday I acquired a keyboard for one of my computers, specifically the Genius GX Gaming Scorpion K215 grata was my surprise when activating the backlight of it in Windows.
Minutes later my dear Deepin started but the good does not last forever, when I pressed the light switch, nothing happened. So I decided to look for the solution to the problem that apparently is present in many distributions.
I quickly detected that running xset led 3 in a terminal, the lighting came on; while to turn it off, you had to run xset led 3 led off. The challenge was to automate this function in the simplest way and assign the corresponding key on the keyboard.
After failing with dconf-editor, instinct made me think of a script that would carry out the task, and turn on the system, but it was not the way it worked in windows. So choose to combine a little bash script with the system tools.
- We will open the Deepin control center, go to the keyboard settings and display custom shortcuts, we start by filling in the name box. For the example I chose Keyboard light.
- Next we paste the script that I leave below, in the command box.
if [ -f /tmp/keyboard_light ]; then xset -led 3 && rm /tmp/keyboard_light else xset led 3 && touch /tmp/keyboard_light fi
- Later we go to the last box, called "Shortcuts" we click on "None" and then we will press the combination of keys that we choose to carry out the action. In my case Control and Scrollock which is the physical key that turns on the backlight. Finally we restart the session.
- As the image shows, the magic has been done but there are still things to fine-tune, since the Deepin control center only allows you to associate a key combination with an action, but does not support assigning a single key.
- To achieve this we open the file manager and in its configuration options we check, show hidden files. Now we go to the home folder on the path .config / deepin / dde-daemon / keybinding and we will edit the file custom.ini
- In it we appreciate that the two keys previously used are represented, we proceed to eliminate the highlighted in blue that corresponds to the control key, save and restart the session.
The goal has been met and the backlight will now go on and off when you press the physical key assigned by the keyboard manufacturer.
We hope you find it useful and we are waiting for the final version of Deepin 20. «Take care«.