Skip to content

fix(walls,screensaver): work on IM6, dismissable mpv, loud errors#93

Merged
VictorGSchneider merged 1 commit into
mainfrom
claude/fix-wallpaper-screensaver-scripts-Ex9E6
May 11, 2026
Merged

fix(walls,screensaver): work on IM6, dismissable mpv, loud errors#93
VictorGSchneider merged 1 commit into
mainfrom
claude/fix-wallpaper-screensaver-scripts-Ex9E6

Conversation

@VictorGSchneider
Copy link
Copy Markdown
Owner

@VictorGSchneider VictorGSchneider commented May 11, 2026

Problema

Os scripts stoa-walls.sh e stoa-screensaver.sh "não funcionavam" por uma combinação de bugs reais:

stoa-walls.sh

  1. Exigia rigidamente magick (IM7) e abortava em sistemas com só convert (IM6). O comentário no script afirmava que "a sintaxe IM6 não é compatível" — testei e é compatível: todos os comandos (gradient:, xc:, -draw rectangle, -annotate, -blur) funcionam idênticos em ambas versões.
  2. Fonte hardcoded JetBrains-Mono (com hífen) não resolve via fontconfig em muitos casos — o nome canônico da família é JetBrains Mono (com espaço). Sem fallback, o texto de memento.png sumia silenciosamente.

stoa-screensaver.sh

  1. Mesmo problema do magick exclusivo.
  2. Sem checagem de dependências (ffmpeg, mpv): falhas confusas se faltassem.
  3. ffmpeg ... 2>/dev/null engolia todo erro de encode, então uma falha de codec/policy resultava em vídeo 0 byte sem nenhuma mensagem.
  4. mpv impossível de dispensar pelo teclado: lançado com --no-input-default-bindings e --input-conf=/dev/null, ou seja, todas as keybindings desativadas. Quem caísse no screensaver não conseguia sair via Esc/q.
  5. --input-vo-keyboard=yes é opção legada/X11 que mpv recente ignora ou marca como deprecada.

Fixes

  • Detecta magick (IM7) ou convert (IM6) em runtime; usa o que existir.
  • stoa-walls.sh: lista de candidatos de fonte mono com fallback (JetBrains MonoJetBrainsMono-RegularDejaVu Sans Mono → default do IM).
  • stoa-screensaver.sh:
    • Checa imagemagick/ffmpeg/mpv antes de gastar minutos renderizando.
    • ffmpeg em -loglevel error (não silenciado) + verificação de exit code.
    • Gera um mpv-input.conf mínimo mapeando qualquer tecla/clique → quit, e usa --no-config para isolamento.
    • brightnessctl agora condicional (command -v).

Test plan

  • stoa-walls gera os 4 wallpapers (1920×1080 PNG) usando convert (IM6) num sistema sem magick. Verificado em sandbox.
  • stoa-screensaver generate (rodado com total_frames=12 para smoke test) produz marble-flow.mp4 h264 1920×1080 válido com ffprobe.
  • stoa-screensaver start em Hyprland: tecla qualquer deve fechar o mpv (não testável no sandbox sem display).
  • Em sistema com magick (IM7, ex.: Arch atual), comportamento idêntico ao anterior.
  • Verificar que JetBrains Mono é encontrado quando ttf-jetbrains-mono está instalado.

Generated by Claude Code

stoa-walls.sh and stoa-screensaver.sh hard-required ImageMagick 7
(`magick`) and bailed on systems with only IM6 (`convert`), even though
the gradient/draw/CLUT/plasma syntax they use is identical across both
versions. Detect either binary at runtime and use it.

stoa-walls.sh: fall back across reasonable mono font family names
("JetBrains Mono" with space is the canonical fontconfig family; the
hyphenated form often fails to resolve and silently drops the text).

stoa-screensaver.sh:
- Check imagemagick/ffmpeg/mpv up front and report what's missing instead
  of producing a 0-byte video.
- Stop hiding ffmpeg stderr; surface errors so policy/codec issues are
  diagnosable.
- mpv was launched with --no-input-default-bindings AND an empty
  input-conf, which made the screensaver impossible to dismiss with the
  keyboard. Generate a minimal input.conf that maps any key / mouse
  click to quit, and drop the deprecated --input-vo-keyboard option.
- Guard brightnessctl calls behind a command -v check.
@VictorGSchneider VictorGSchneider merged commit 58bda49 into main May 11, 2026
1 check passed
@VictorGSchneider VictorGSchneider deleted the claude/fix-wallpaper-screensaver-scripts-Ex9E6 branch May 11, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants