You are not logged in.

#1 2020-04-19 14:21:03

W1F3B34T3R
Banned
Registered: 2020-04-06
Posts: 12

[SOLVED]scroll lock

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

#2 2020-04-19 19:19:13

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,008

Re: [SOLVED]scroll lock

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

#3 2020-04-20 14:01:36

W1F3B34T3R
Banned
Registered: 2020-04-06
Posts: 12

Re: [SOLVED]scroll lock

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

#4 2020-04-20 14:11:30

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,008

Re: [SOLVED]scroll lock

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

#5 2026-07-10 15:31:27

fahim.chuchu
Member
Registered: 2026-07-10
Posts: 3

Re: [SOLVED]scroll lock

Use Scroll Lock to turn on/off Keyboard Backlight

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.

  1. Install numlockx:
    Ubuntu / Debian / Mint:

    sudo apt install numlockx

    Fedora / RHEL:

    sudo dnf install numlockx

    Arch / Manjaro:

    sudo pacman -S numlockx
  2. Paste 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
    fi
  3. Bind Keyboard Shortcut:

    • Goto Keyboard

    • Add

      /usr/local/bin/toggle_led.sh
    • Press Scroll Lock

    • Keep the Startup Notification turned off.

  4. 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 led

command. If you don't have numpad in your keyboard, you can skip the Step-1 and also remove the

numlockx on

lines from the script.

Last edited by fahim.chuchu (2026-07-10 15:53:13)

Offline

#6 2026-07-10 17:58:46

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,690

Re: [SOLVED]scroll lock

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

Board footer

Powered by FluxBB