dead simple fetch program configured via the source code itself written in arturo.
0
afetch.art
1; All configuration for AFETCH is done via this file.
2; This is also where all the code lives.
3
4; This script in it's base state is ONLY usable on LINUX and/or other unix-like systems.
5; However, with a little bit of modification (which you're supposed to do anyways), it can work on Windows as-well.
6
7infolines: 3 ; make sure neither the art nor the info will be cut off!
8
9; ART (heh.. get it..? because its the file extension...?)
10
11linelen: 3
12space: 2
13art: ["OWO"
14 ":3"
15 "UwU"]
16
17; INFO
18
19infolist: [] ; this is in order! add to it in the order you want it to be!
20
21osReleaseRaw: read "/etc/os-release"
22
23id: get match osReleaseRaw {/(?m)(?<=^ID=).[^\n]*/} 0; copy the regex & replace "ID" to be anything in /etc/os-release
24uptime: execute "uptime -p"
25user: execute "whoami"
26
27'infolist ++ user
28'infolist ++ id
29'infolist ++ uptime
30
31loop.with:'i infolist 'a [
32 set infolist i strip.start.end a
33]
34
35; PUT IT TOGETHER
36output: ""
37
38loop infolines 'i [
39 f: i - 1
40 wslen: size split get art f | sub linelen
41 | abs
42 | add space
43 ws: to :string 10 ^ wslen | replace "1" ""
44 | replace "0" " "
45 "" | append get art f
46 | append ws
47 | append get infolist f
48 | print
49]