This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Unconventional task

Tags: None
(comma "," separated)
User avatar
pebe
Registered Member
Posts
1
Karma
0
OS

Unconventional task

Wed Jan 12, 2022 4:29 pm
Hello everyone.

I apologize in advance for a non-speaking topic, but let me explain everything.
I am looking for a solution that would allow me to run a command when the system asks the user to log in, but not at startup, but when the login screen appears - that is, every time I want to unlock the computer (system)

I wanted to use the above behavior to set my own keyboard backlight. The backlight is turned off when the system is locked, and turned on when the system is unlocked.

It wouldn't be a problem if it wasn't for the fact that the labels on the keys are only visible when the keyboard is backlit :) Most of the time it is not a big problem for me, but there are times when I have a hard time locating the keys. Besides, I wanted to introduce such a little feature to my system :)

I've got the scripts for setting the backlighting done using the Polychromatic CLI, I just need to "paste" them somewhere where they will run appropriately. And here comes the question: Is there such a place, and if there is, where? ;D
I'll point out that setting the script in KDE notifications (System Settings->Notifications->Screen Saver) is out of the question.

I will be grateful for any hints that would help me accomplish the above task.
gjoe
Registered Member
Posts
3
Karma
0

Re: Unconventional task

Wed Jan 26, 2022 5:22 am
That looks like you need to create code, so you may be interest in having a button in your login screen to increase the backlight in your keyboard.

1) I would recommend looking for help on how to make a customize sddm. The problem is you would need to update your code everytime sddm updates.

-https://github.com/sddm/sddm (which is your login screen)

2) Other solution is settings a rule in systemctl to turn on your backlight when its late (aka 8 pm or later), in this case you need to know systemd, you can find more info in your terminal:
$man systemctl

Or maybe in internet
-https://wiki.archlinux.org/title/Systemd
dzon
Registered Member
Posts
493
Karma
3

Re: Unconventional task

Wed Jan 26, 2022 7:14 am
What happens if you add this to autostart?
/usr/bin/xset led 3
If nothing, some suggest to create /etc/rc.local, containing:
#!/bin/bash
/usr/bin/xset led 3


This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS

Re: Unconventional task

Wed Jan 26, 2022 11:15 am
Hi!

You could monitor the dbus-events to catch those locks, but it would be easier to use the GUI to setup this behaviour:
Systemsettings → Personalization/Notifications → Configure… → Screen Saver → Configure Events…
Enter a command or script on (un-)locked.
dzon
Registered Member
Posts
493
Karma
3

Re: Unconventional task

Wed Jan 26, 2022 11:53 am
Yes, that's right. This might be helpful to determine what to run exactly: https://wiki.archlinux.org/title/Keyboard_backlight


This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]