mirror of
https://github.com/curly60e/pyblock.git
synced 2026-08-13 12:33:15 +02:00
New clock/ package replaces the old design() polling loop with a flicker-free ANSI cursor-positioned renderer. Features include: countdown timer, epoch/halving progress bar, fee rate indicator, hashrate sparkline, matrix mining animation, odometer digit transition, heartbeat pulse, zen mode, UTC time display, fireworks on milestone blocks, generative hash art, and configurable sound modes. All features are toggleable via Settings → D (Clock Display Settings). Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(), and TUI startup to use the cfg singleton instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
23 lines
556 B
Python
23 lines
556 B
Python
"""Configurable sound notifications for new blocks."""
|
|
|
|
import sys
|
|
import time
|
|
|
|
|
|
def play_sound(mode):
|
|
"""Play sound notification based on mode setting.
|
|
|
|
mode: 'bell' (single beep), 'pattern' (rhythmic), 'silent' (nothing)
|
|
"""
|
|
if mode == 'silent':
|
|
return
|
|
elif mode == 'pattern':
|
|
# Three short beeps
|
|
for _ in range(3):
|
|
sys.stdout.write('\a')
|
|
sys.stdout.flush()
|
|
time.sleep(0.15)
|
|
else:
|
|
# Default: single bell
|
|
sys.stdout.write('\a')
|
|
sys.stdout.flush()
|