8501fd074c
Go TUI sleep timer with modular architecture. - Config: YAML-based, profile inheritance, auto WM detection - Engine: timer, executor, stage pipeline (pre→timer→post) - Modules: workspace (niri/hyprland/kde), media, lock, kill, notify, sound, brightness, mute, custom, script - TUI: bubbletea app with profiles, module toggles, progress bar - CLI: run, list-profiles, export, import, history, stats - History: JSONL log with statistics - QR: config export as ASCII QR
18 lines
393 B
Go
18 lines
393 B
Go
package tui
|
|
|
|
import (
|
|
"fmt"
|
|
qrcode "github.com/skip2/go-qrcode"
|
|
)
|
|
|
|
// GenerateQR returns a string of the QR code for the given data
|
|
func GenerateQR(data string) (string, error) {
|
|
qr, err := qrcode.New(data, qrcode.Medium)
|
|
if err != nil {
|
|
return "", fmt.Errorf("qr generate: %w", err)
|
|
}
|
|
// Convert to ASCII art
|
|
art := qr.ToString(true)
|
|
return art, nil
|
|
}
|