slock: pantalla con reloj, fecha, batería y barra de estado

El fondo es fijo y el color del estado (inicio, escribiendo, error) pasa a
una barra inferior. Se muestran la hora, la fecha, un punto por carácter
tecleado, el usuario y la batería, refrescando reloj y batería cada
segundo. Usa Xft y los iconos de Symbols Nerd Font.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016UdJsHrbkmzhoCb6TthP2m
This commit is contained in:
Alejandro Guerrero 2026-09-27 14:29:49 +02:00
parent c736ea8b01
commit ce3a0db5bf
4 changed files with 382 additions and 34 deletions

View file

@ -2,11 +2,28 @@
static const char *user = "nobody";
static const char *group = "nogroup";
/* colores de la barra inferior según el estado */
static const char *colorname[NUMCOLS] = {
[INIT] = "#2d353b", /* after initialization (fondo Everforest) */
[INIT] = "#475258", /* after initialization (gris Everforest) */
[INPUT] = "#a7c080", /* during input (verde acento) */
[FAILED] = "#e67e80", /* wrong password (rojo Everforest) */
};
/* pantalla de bloqueo (paleta Everforest) */
static const char *bgcolor = "#2d353b"; /* fondo */
static const char *fgcolor = "#d3c6aa"; /* reloj y texto */
static const char *dimcolor = "#859289"; /* fecha y avisos */
static const char *clockfont = "Fira Code:style=Bold:pixelsize=160:antialias=true";
static const char *datefont = "Fira Code:pixelsize=34:antialias=true";
static const char *textfont = "Fira Code:pixelsize=22:antialias=true";
static const char *iconfont = "Symbols Nerd Font Mono:pixelsize=24:antialias=true";
static const int barheight = 10; /* alto de la barra inferior */
static const unsigned int maxdots = 24; /* puntos máximos al teclear */
static const char *battery = "BAT1"; /* /sys/class/power_supply/... */
static const int batterylow = 20; /* % para mostrarla en rojo */
/* treat a cleared input like a wrong password (color) */
static const int failonclear = 1;