Calendario en la barra, prompt con rama de git, historial compartido e impresora

- calendario (home/.local/bin): clic izquierdo en la fecha de la barra
  (zona \004 en slstatus, statuscmd 4 en dwm) muestra el mes en una
  notificación, empezando en lunes y con hoy en verde.
- .bashrc: rama de git en el prompt (git-prompt.sh, con * y +) e
  historial grande, sin duplicados y compartido entre terminales.
- install.sh: cups, cups-filters y hplip, servicio cupsd y grupo lpadmin.

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 22:04:47 +02:00
parent 68427bdf7a
commit 2870ac7dca
Signed by: alejandrogs73
GPG key ID: 1CFF10953BEE333C
6 changed files with 56 additions and 10 deletions

View file

@ -25,8 +25,25 @@ YELLOW='\[\e[0;33m\]'
BLUE='\[\e[0;34m\]'
NC='\[\e[0m\]' # Sin color
# Formato: usuario@maquina:~/directorio$ (en colores)
PS1="${GREEN}\u@\h${NC}:${BLUE}\w${NC}\$ "
# Rama de git (con * si hay cambios sin añadir y + si hay cambios añadidos)
if [ -f /usr/share/git/git-prompt.sh ]; then
. /usr/share/git/git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=1
else
__git_ps1() { :; }
fi
# Formato: usuario@maquina:~/directorio (rama)$ (en colores)
PS1="${GREEN}\u@\h${NC}:${BLUE}\w${YELLOW}\$(__git_ps1 ' (%s)')${NC}\$ "
# --- Historial ---
# Grande, sin duplicados y compartido entre terminales: cada orden se guarda
# al momento y cada prompt lee las de las otras terminales.
HISTSIZE=10000
HISTFILESIZE=20000
HISTCONTROL=ignoreboth:erasedups
shopt -s histappend
PROMPT_COMMAND="history -a; history -n${PROMPT_COMMAND:+; $PROMPT_COMMAND}"
# --- 3. Aliases Base (Comodidad y Seguridad) ---
alias ls='ls --color=auto'

21
home/.local/bin/calendario Executable file
View file

@ -0,0 +1,21 @@
#!/bin/sh
# Muestra el calendario del mes en una notificación (clic en la fecha de la
# barra de dwm), con la semana empezando en lunes y el día de hoy en verde.
hoy=$(date +%-d)
mes=$(cal -m | head -1 | sed 's/^ *//; s/ *$//')
# Resaltar el número de hoy (solo en las filas de días, no en la cabecera)
dias=$(cal -m | tail -n +2 | awk -v hoy="$hoy" '
NR == 1 { print; next }
{
linea = " " $0 " "
sub(" " hoy " ", " <b><span foreground=\"#a7c080\">" hoy "</span></b> ", linea)
print substr(linea, 2, length(linea) - 2)
}')
# Primera letra del mes en mayúscula ("septiembre 2026" -> "Septiembre 2026")
mes=$(printf %s "$mes" | sed 's/^./\U&/')
notify-send -t 10000 -h string:x-dunst-stack-tag:calendario \
-i x-office-calendar "$mes" "$dias"