#!/bin/sh #| -*- scheme -*- exec csi -s $0 "$@" NOFETCH Copyright (C) 2022 C Duckworth Licensed under the Fair license. See COPYING for details. |# (import (chicken format) (chicken port) (chicken random) (chicken string)) (define (clear) (display #\escape) (display "[2J")) (define-values (terminal-height terminal-width) (if (terminal-port? (current-output-port)) (terminal-size (current-output-port)) (values 24 80))) (define (get thing) (if (< terminal-width 48) "" (format #f "~A:~A~A" thing (make-string (- 10 (string-length (symbol->string thing))) #\space) (case thing ('os "FUCK OFF") ('host "A COMPUTER") ('kernel "IDK") ('uptime "WHO CARES") ('pkgs "OH MY GOD WHO CARES") ('memory (pseudo-random-integer (* 4 (* 1024 (* 1024 1024))))))))) (define message #<#END _______ / ===== \ #(get 'os) | _______ | #(get 'host) | | - | | #(get 'kernel) | |_____| | #(get 'uptime) \_=_______/ #(get 'pkgs) / ::::::: \ #(get 'memory) (___________) NOBODY CARES ABOUT YOUR STUPID COMPUTER. END ) (define short-message "NOBODY CARES ABOUT YOUR STUPID COMPUTER.\n") (define message-height (length (string-split message "\n" #t))) (define (main) (clear) (let ((n (- terminal-height message-height 4))) (if (> n 0) (begin (display message) (display (make-string n #\newline))) (display short-message)))) (main)