diff options
author | Case Duckworth | 2022-07-18 16:35:10 -0500 |
---|---|---|
committer | Case Duckworth | 2022-07-18 16:35:10 -0500 |
commit | 651355672bf2484fbb6894f99efe9126daa5db97 (patch) | |
tree | 4098a441c25392599b5e8bc6eb803bf99bed95f5 | |
download | nofetch-651355672bf2484fbb6894f99efe9126daa5db97.tar.gz nofetch-651355672bf2484fbb6894f99efe9126daa5db97.zip |
Initial commit
-rwxr-xr-x | nofetch.scm | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/nofetch.scm b/nofetch.scm new file mode 100755 index 0000000..340d9ac --- /dev/null +++ b/nofetch.scm | |||
@@ -0,0 +1,60 @@ | |||
1 | #!/bin/sh | ||
2 | #| -*- scheme -*- | ||
3 | exec csi -s $0 "$@" | ||
4 | |# | ||
5 | |||
6 | (import (chicken format) | ||
7 | (chicken random) | ||
8 | (chicken string) | ||
9 | posix-utils) | ||
10 | |||
11 | (define (clear) | ||
12 | (display #\escape) | ||
13 | (display "[2J")) | ||
14 | |||
15 | (define terminal-size (get-terminal-size)) | ||
16 | (define terminal-width (cadr terminal-size)) | ||
17 | (define terminal-height (car terminal-size)) | ||
18 | |||
19 | (define (get thing) | ||
20 | (if (< terminal-width 48) | ||
21 | "" | ||
22 | (format #f "~A:~A~A" | ||
23 | thing | ||
24 | (make-string (- 10 (string-length (symbol->string thing))) #\space) | ||
25 | (case thing | ||
26 | ('os "FUCK OFF") | ||
27 | ('host "A COMPUTER") | ||
28 | ('kernel "IDK") | ||
29 | ('uptime "WHO CARES") | ||
30 | ('pkgs "OH MY GOD WHO CARES") | ||
31 | ('memory (pseudo-random-integer (* 4 (* 1024 (* 1024 1024))))))))) | ||
32 | |||
33 | (define message #<#END | ||
34 | _______ | ||
35 | / ===== \ #(get 'os) | ||
36 | | _______ | #(get 'host) | ||
37 | | | - | | #(get 'kernel) | ||
38 | | |_____| | #(get 'uptime) | ||
39 | \_=_______/ #(get 'pkgs) | ||
40 | / ::::::: \ #(get 'memory) | ||
41 | (___________) | ||
42 | |||
43 | NOBODY CARES ABOUT YOUR STUPID COMPUTER. | ||
44 | END | ||
45 | ) | ||
46 | |||
47 | (define short-message "NOBODY CARES ABOUT YOUR STUPID COMPUTER.\n") | ||
48 | |||
49 | (define message-height | ||
50 | (length (string-split message "\n" #t))) | ||
51 | |||
52 | (define (main) | ||
53 | (clear) | ||
54 | (let ((n (- terminal-height message-height 4))) | ||
55 | (if (> n 0) | ||
56 | (begin (display message) | ||
57 | (display (make-string n #\newline))) | ||
58 | (display short-message)))) | ||
59 | |||
60 | (main) | ||