about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2023-01-10 09:19:25 -0600
committerCase Duckworth2023-01-10 09:19:25 -0600
commitf3ea1783e110b9570c184937bf4b0f89ce9723a2 (patch)
tree2923aa9eff9419a7153e56aa585b5c0cba8fafa0
parentAdd screenshot (diff)
downloadnofetch-f3ea1783e110b9570c184937bf4b0f89ce9723a2.tar.gz
nofetch-f3ea1783e110b9570c184937bf4b0f89ce9723a2.zip
Allow output to a non-terminal HEAD main
Also remove dependency on posix-utils.
-rwxr-xr-xnofetch.scm11
1 files changed, 6 insertions, 5 deletions
diff --git a/nofetch.scm b/nofetch.scm index 01c26c3..88bb3e9 100755 --- a/nofetch.scm +++ b/nofetch.scm
@@ -7,17 +7,18 @@ Licensed under the Fair license. See COPYING for details.
7|# 7|#
8 8
9(import (chicken format) 9(import (chicken format)
10 (chicken port)
10 (chicken random) 11 (chicken random)
11 (chicken string) 12 (chicken string))
12 posix-utils)
13 13
14(define (clear) 14(define (clear)
15 (display #\escape) 15 (display #\escape)
16 (display "[2J")) 16 (display "[2J"))
17 17
18(define terminal-size (get-terminal-size)) 18(define-values (terminal-height terminal-width)
19(define terminal-width (cadr terminal-size)) 19 (if (terminal-port? (current-output-port))
20(define terminal-height (car terminal-size)) 20 (terminal-size (current-output-port))
21 (values 24 80)))
21 22
22(define (get thing) 23(define (get thing)
23 (if (< terminal-width 48) 24 (if (< terminal-width 48)