Zeal-Operating-System / ZealOS

The Zeal Operating System is a modernized fork of the 64-bit Temple Operating System, TempleOS.
https://zealos.net
The Unlicense
1.47k stars 68 forks source link

WallPaperDolDoc #123

Open y4my4my4m opened 1 year ago

y4my4my4m commented 1 year ago

To add to the wiki if this gets merged

png to ansi convertion script

#!/bin/bash

function ANSi() {
    tr '\0' ' ' < "$1" | iconv -f CP437 -t UTF8
}

# Check if argument is passed
if [ $# -eq 0 ]
then
    echo "No arguments supplied"
    exit 1
fi

REZ=1024
# REZ=1280

# 1024x768
ansir --width 127 --height 95 --colors basic --background dark --mode shaded "png/$REZ/$1.png" > "ans/$REZ/$1.ans"

# 1280x720
# ansir --width 159 --height 89 --colors basic --background dark --mode shaded "png/$REZ/$1.png" > "ans/$REZ/$1.ans"

# Second command
python convert_nfo.py "ans/$REZ/$1.ans" "ans/$REZ/$1.ans"

# Third command
ANSi "ans/$REZ/$1.ans"

cp "ans/$REZ/$1.ans" "ZealOS/src/Home/Wallpapers/1024/$1_$REZ.ans"

Ansir is this tool: https://github.com/y4my4my4m/ansir

I'll add a complete tutorial on the wiki in due time

y4my4my4m commented 9 months ago

Forgot to include: convert_nfo.py

#!/usr/bin/env python
import codecs, sys
try:
    infile, outfile = sys.argv[1], sys.argv[2]
except IndexError:
    sys.stderr.write('usage: %s input_file output_file\n' % sys.argv[0])
    sys.exit(1)
nfo = codecs.open(infile, encoding='utf-8').read()
codecs.open(outfile, 'w', encoding='cp437').write(nfo)