chamesle

chamesle.org: the site of Chamesle, a small Linux distribution
git clone https://github.com/tortr-rs/chamesle
Log | Files | Refs | README

commit 94956257f270a83f471a85500c7a3ab782b5b602
parent 1ffa1f860af9830d61470e8a3f8b4868a19c3997
Author: torter <koubbamohamedrayan@gmail.com>
Date:   Mon, 16 Nov 2026 21:54:53 +0000

Revert "fastfetch logo: the banner drawn in half blocks, the ring in its colours and the name in the terminal's own"

This reverts commit 8bbdd8aff89db4b1f88e8a3a3f7c784a036ebcbe.

Diffstat:
Martwork/ascii.py | 66++++++++++++++++++++----------------------------------------------
Martwork/render.sh | 2+-
2 files changed, 21 insertions(+), 47 deletions(-)

diff --git a/artwork/ascii.py b/artwork/ascii.py @@ -1,64 +1,38 @@ #!/usr/bin/env python3 -# a png as a coloured text logo for fastfetch ($1 green, $2 red, $3 blue, $9 the terminal's own colour) -# usage: ascii.py logo.png COLS > logo.txt the mark on its own, drawn with # -# ascii.py banner.png COLS ROWS > logo.txt the banner, half blocks, ROWS text rows tall +# logo.png as a coloured text logo for fastfetch ($1 green, $2 red, $3 blue) +# usage: ascii.py logo.png COLS > logo.txt import sys from cutout import read_png w, h, px = read_png(sys.argv[1]) cols = int(sys.argv[2]) -half = len(sys.argv) > 3 -rows = int(sys.argv[3]) if half else cols // 2 -sub = 2 if half else 1 - - -def kind(x0, x1, y0, y1): - votes = {} - for y in range(y0, max(y1, y0 + 1), 2): - for x in range(x0, max(x1, x0 + 1), 2): - R, G, B, A = px[y * w + x] - if A < 128: - k = None - elif max(R, G, B) < 110: - k = '9' - elif G > R and G > B: - k = '1' - elif R > G and R > B: - k = '2' - else: - k = '3' - votes[k] = votes.get(k, 0) + 1 - k = max(votes, key=votes.get) - return None if k is None or votes[k] < sum(votes.values()) * 0.4 else k - - +rows = cols // 2 out = [] for r in range(rows): line, cur = '', None for c in range(cols): - x0, x1 = c * w // cols, (c + 1) * w // cols - parts = [kind(x0, x1, (r * sub + s) * h // (rows * sub), (r * sub + s + 1) * h // (rows * sub)) for s in range(sub)] - if half: - top, bot = parts - if top and bot: - ch, k = '█', top - elif top: - ch, k = '▀', top - elif bot: - ch, k = '▄', bot - else: - line += ' ' - continue - elif parts[0]: - ch, k = '#', parts[0] - else: + votes = {} + for y in range(r * h // rows, (r + 1) * h // rows, 3): + for x in range(c * w // cols, (c + 1) * w // cols, 3): + R, G, B, A = px[y * w + x] + if A < 128: + k = None + elif G > R and G > B: + k = '1' + elif R > G and R > B: + k = '2' + else: + k = '3' + votes[k] = votes.get(k, 0) + 1 + k = max(votes, key=votes.get) + if k is None or votes[k] < sum(votes.values()) * 0.4: line += ' ' continue if k != cur: line += '$' + k cur = k - line += ch + line += '#' out.append(line.rstrip()) -while out and not out[-1].replace('$1', '').replace('$2', '').replace('$3', '').replace('$9', '').strip(): +while out and not out[-1].replace('$1', '').replace('$2', '').replace('$3', '').strip(): out.pop() print('\n'.join(out)) diff --git a/artwork/render.sh b/artwork/render.sh @@ -26,7 +26,7 @@ rm -rf $tmp # text logo for fastfetch mkdir -p $out/chamesle -python3 ascii.py banner.png 78 8 > $out/chamesle/logo.txt +python3 ascii.py logo.png 34 > $out/chamesle/logo.txt # login screen logo: the mark and the name, white text (FONTS=dir with Inter in it) mkdir -p $look/chamesle