Zum Hauptinhalt springen
••
Unix & Linux ServerWe View Consumer Data as Toxic Waste(03.10.2026 um 09:47 Uhr)
••
Sichere ProgrammierungThe Jira form smart value that writes nothing and reports success(03.10.2026 um 13:21 Uhr)
•
Sichere ProgrammierungYour Search Box Lags. Debounce Hides It; `useTransition` Fixes It(03.10.2026 um 13:21 Uhr)
•
Sichere ProgrammierungReact 19.3 ViewTransition: Animate State Without Losing It(03.10.2026 um 13:22 Uhr)
••
Sichere ProgrammierungAutomation Runbooks Need a Dry-Run Contract(03.10.2026 um 13:23 Uhr)
•
Sichere ProgrammierungWant to Contribute to Open Source? Join Me in Building 8DoTs(03.10.2026 um 13:24 Uhr)
•••
Unix & Linux ServerWe View Consumer Data as Toxic Waste(03.10.2026 um 09:47 Uhr)
••
Sichere ProgrammierungThe Jira form smart value that writes nothing and reports success(03.10.2026 um 13:21 Uhr)
•
Sichere ProgrammierungYour Search Box Lags. Debounce Hides It; `useTransition` Fixes It(03.10.2026 um 13:21 Uhr)
•
Sichere ProgrammierungReact 19.3 ViewTransition: Animate State Without Losing It(03.10.2026 um 13:22 Uhr)
••
Sichere ProgrammierungAutomation Runbooks Need a Dry-Run Contract(03.10.2026 um 13:23 Uhr)
•
Sichere ProgrammierungWant to Contribute to Open Source? Join Me in Building 8DoTs(03.10.2026 um 13:24 Uhr)
•
Intelligence View
⚡ tsecurity.de Intelligence

Automatic backlit keyboard script... is there a better way?

Hi there, I read someone mentionning an automatic backlit keyboard (start typing and it automatically switches backlit on). It looks like a no brainer but I…

Beitrag
0
Seite
0
↗ Quelle (reddit.com)
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!

Hi there,

I read someone mentionning an automatic backlit keyboard (start typing and it automatically switches backlit on). It looks like a no brainer but I didn't find an equivalent on Linux, so I put together a (minimal and ugly) bash script to do just that.

WARNING: it works for me (Thinkpad T480S on Fedora), but it probably won't work on other hardware / distros. Plus it needs to be run as root, so be extra careful!

#!/bin/bash # # CONFIGURATION # # seconds until lights are off off_time=5 # tenths of seconds between keyboard polling polling_time=5 # when shoud we light up keyboard startup_time=20:00 # when do we stop lighting up the keyboard end_time=08:00 # keyboard can be off(0), dimmed(1) or full beams(2) # so you can configure your off and on values on_value=1 off_value=0 # check for root user if [[ $EUID -ne 0 ]]; then echo "This script must be run as root" exit 1 fi # INIT VARIABLES counter=1 light_status=off # polling time in seconds polling_time_s=$(bc <<< "scale=1;$polling_time / 10") # how many counter to wait for the correct(ish) off_time off_time_counter=$(bc <<< "scale=0; (1 / $polling_time_s ) * $off_time") # getting the keyboard (hopefully) keyboard=`xinput list --id-only "Virtual core keyboard" ` keyboard="/dev/input/event${keyboard}" # getting the backlight class (hopefully) backlight=`find /sys/class | grep kbd_backlight` backlight="${backlight}/brightness" while true; do current_time=$(date +%H:%M) if [[ "$current_time" > "$startup_time" ]] || [[ "$current_time" < "$end_time" ]]; then # get input from keyboard POLL=`timeout $polling_time_s cat $keyboard` # keyboard is active, switch lights on if [ "$POLL" ]; then counter=1 if [ "$light_status" == "off" ]; then echo $on_value > $backlight light_status="on" fi # keyboard is inactive... if it stays so for off_time, switch lights off else if [ "$counter" -lt "$off_time_counter" ]; then counter=$((counter + 1)) elif [ "$counter" -eq "$off_time_counter" ]; then echo $off_value > $backlight light_status="off" fi fi else # outside active hours, wait a minute and check again sleep 60 fi done 

Does anyone knows of a better / less hackish / more official implementation?

submitted by /u/jcornuz
[link] [comments]
🔍 CTI & Forensik

Cyber Threat Intelligence & Forensik

ATT&CK-Navigator · IoC-Radar · Exploit-Belege
MITRE ATT&CK Matrix Navigator
Enterprise-Matrix · nur belegte Techniken
14 Taktiken
1 belegte Technik
T1059TA0002 · Execution
Command and Scripting Interpreter
Mitigation: M1038 Execution Prevention & Script Block Logging
Quelle: Kontext-Klassifikation des Artikeltextes
Reconnaissance
Resource Development
Initial Access
Execution
Persistence
Privilege Escalation
Defense Evasion
Credential Access
Discovery
Lateral Movement
Collection
Command and Control
Exfiltration
Impact
CTI Threat Relationship Graph
Akteure · Techniken · Beziehungen
4 Knoten · 3 Relationen
CVE / Incident Threat Actor Software MITRE ATT&CK CWE Weakness IoC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Automatic backlit keyboard script... is there a better way?

Thematisch verwandte Begriffe: Automatic, backlit, keyboard, script · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
Nächster Beitrag