From 651355672bf2484fbb6894f99efe9126daa5db97 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 18 Jul 2022 16:35:10 -0500 Subject: Initial commit --- nofetch.scm | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 nofetch.scm diff --git a/nofetch.scm b/nofetch.scm new file mode 100755 index 0000000..340d9ac --- /dev/null +++ b/nofetch.scm @@ -0,0 +1,60 @@ +#!/bin/sh +#| -*- scheme -*- +exec csi -s $0 "$@" +|# + +(import (chicken format) + (chicken random) + (chicken string) + posix-utils) + +(define (clear) + (display #\escape) + (display "[2J")) + +(define terminal-size (get-terminal-size)) +(define terminal-width (cadr terminal-size)) +(define terminal-height (car terminal-size)) + +(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) -- cgit 1.4.1-21-gabe81