slstatus: VOL y BT cada 10 s o al recibir SIGUSR1

Componente lento: run_command con caché. slstatus.c cuenta las SIGUSR1
para que se refresque en cuanto un script o un clic lo pide. Así ya no se
lanzan wpctl y bluetoothctl cada 2 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5v1qWDwgkaVM5kjVHGGh8
This commit is contained in:
Alejandro Guerrero 2026-09-28 15:38:41 +02:00
parent 73d005dd30
commit 3864c31ba1
Signed by: alejandrogs73
GPG key ID: 1CFF10953BEE333C
4 changed files with 58 additions and 2 deletions

View file

@ -168,6 +168,11 @@ and which area is which is marked by the `\001`...`\004` bytes in
| BT | `OFF`, or the connected device and its battery if it reports it (`VJ 901 100%`) | `bluetooth` menu: connect, disconnect, scan and pair, power off | | Power on or off | |
| Date | Day and time | This month's calendar (`calendario`) | | | |
VOL and BT are not read every 2 s like the rest, but every 10 s or as soon as
`SIGUSR1` arrives (`lento` component in slstatus's `config.h`): `volumen`,
`bluetooth`, `wifi` and the clicks send it, so your own changes show up at
once and wpctl and bluetoothctl are not spawned every 2 s.
After changing dwm's `config.h`, reinstall and restart it for new clicks to
work: `pkill -HUP dwm` restarts it without closing windows (restartsig and
preserveonrestart patches).
@ -236,5 +241,7 @@ preserveonrestart patches).
- In st, Ctrl+Shift+right click on an image opens it in `nsxiv`.
- st shows images with the kitty graphics protocol; yazi detects it on its
own and shows previews without ueberzugpp.
- slstatus.c has a hand-made change (not a patch): it counts `SIGUSR1`
signals so `lento` knows when to refresh.
- slock is modified by hand (not a patch): clock, date, battery and a bottom
bar with the state colour.