You are not logged in.
Pages: 1
Topic closed
My keyboard's rgb lighting works when i press the scroll lock button but i can't use that feature in arch so i made a bash script which lets me use scroll lock, but the problem is that i don't want to execute it every time i log into my computer, i have tried using the auto start feature in kde plasma but that doesn't works in the way i want. Even after executing the bash file after i log into my system it still looses it's functionality after half an hour or something around that. Here's the code i'm using right now
xmodmap -e 'add mod3 =Scroll_Lock'.
Last edited by W1F3B34T3R (2020-11-01 03:10:27)
Offline
Put an executable script in ~/.config/plasma-workspace/env/
it still looses it's functionality after half an hour or something around that
Sound like the keyboard gets re-attached (eg. for a power save or layout change) - afaics you'd have to deviate a custom layout or run the script periodically.
Offline
i just did that, but it didn't do anything. I still had to manually run the script to activate the scroll lock key.
Offline
Did what precisely?
What do script and/or custom layout look like and did you ensure it's (still) loaded?
(For the script, you could add some "echo foo > /tmp/bar" to track whether it ran)
Offline
Finally, I have got the exact solution after suffering and trying many methods for 2 years. This method works on XFCE system without any problem. For other DEs, try and see if it works.
Install numlockx:
Ubuntu / Debian / Mint:
sudo apt install numlockxFedora / RHEL:
sudo dnf install numlockxArch / Manjaro:
sudo pacman -S numlockxPaste the script:
cd /usr/local/bin/sudo nano toggle_led.sh#!/bin/bash
if xset q | grep -q "Scroll Lock: off"; then
xset led named "Scroll Lock"
numlockx on
else
xset -led named "Scroll Lock"
numlockx on
fiBind Keyboard Shortcut:
Goto Keyboard
Add
/usr/local/bin/toggle_led.shPress Scroll Lock
Keep the Startup Notification turned off.
Log out & Relogin your session.
Now, pressing the Scroll Lock will turn on/off the keyboard light.
Extra Note: numlockx is required to keep the numpad working after executing
xset ledcommand. If you don't have numpad in your keyboard, you can skip the Step-1 and also remove the
numlockx onlines from the script.
Last edited by fahim.chuchu (2026-07-10 15:53:13)
Offline
Using this opportunity to close this old thread.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
Pages: 1
Topic closed