Last active 1788248311

Revision 7561ba4ff93b64232a67bb79eea1b867cd68b0c4

config.jsonc Raw
1{
2 "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
3
4 "display": {
5 "separator": ": ",
6 "showErrors": false
7 },
8
9 "modules": [
10 "title",
11 "separator",
12
13 // Detail macOS Tahoe.
14 {
15 "type": "command",
16 "key": "OS Detail",
17 "text": "printf '%s %s (Build %s) %s\\n' \"$(sw_vers -productName)\" \"$(sw_vers -productVersion)\" \"$(sw_vers -buildVersion)\" \"$(uname -m)\""
18 },
19
20 "host",
21 "kernel",
22 "uptime",
23 "packages",
24 "shell",
25 "terminal",
26
27 // Akun manusia macOS biasanya memiliki UniqueID >= 501.
28 {
29 "type": "command",
30 "key": "User Accounts",
31 "text": "dscl . -list /Users UniqueID 2>/dev/null | awk '$2 >= 501 && $1 != \"Guest\" && $1 !~ /^_/ {printf \"%s%s\", sep, $1; sep=\", \"} END {if (sep == \"\") printf \"none\"; print \"\"}'"
32 },
33
34 "cpu",
35 "gpu",
36 "memory",
37 "swap",
38
39 {
40 "type": "disk",
41 "key": "Disk"
42 },
43
44 // Ethernet macOS: hardware port, BSD interface, IPv4, status, MAC.
45 {
46 "type": "command",
47 "key": " ",
48 "text": "networksetup -listallhardwareports 2>/dev/null | awk 'BEGIN{RS=\"\"; FS=\"\\n\"} /Hardware Port: (Ethernet|Thunderbolt Ethernet|USB.*LAN|LAN)/ {port=dev=mac=\"\"; for(i=1;i<=NF;i++){if($i ~ /^Hardware Port:/){sub(/^Hardware Port: /,\"\",$i);port=$i} else if($i ~ /^Device:/){sub(/^Device: /,\"\",$i);dev=$i} else if($i ~ /^Ethernet Address:/){sub(/^Ethernet Address: /,\"\",$i);mac=$i}} if(dev!=\"\"){ip=\"\"; st=\"\"; cmd=\"ipconfig getifaddr \" dev \" 2>/dev/null\"; cmd|getline ip; close(cmd); if(ip==\"\")ip=\"no IPv4\"; cmd=\"ifconfig \" dev \" 2>/dev/null\"; while((cmd|getline line)>0){if(line ~ /status:/){sub(/^.*status: /,\"\",line); st=line; break}} close(cmd); if(st==\"\")st=\"unknown\"; printf \"\\033[1;95mEthernet\\033[0m \\033[96m(%s)\\033[0m: %s [\\033[32m%s\\033[0m] - (%s)\\n\",dev,ip,st,mac; found=1}} END{if(!found) printf \"\\033[1;95mEthernet\\033[0m: No Ethernet device found\\n\"}'"
49 },
50
51 // Wi-Fi macOS: cari hardware port Wi-Fi/AirPort lalu tampilkan interface/IP/MAC.
52 {
53 "type": "command",
54 "key": " ",
55 "text": "networksetup -listallhardwareports 2>/dev/null | awk 'BEGIN{RS=\"\"; FS=\"\\n\"} /Hardware Port: (Wi-Fi|AirPort)/ {dev=mac=\"\"; for(i=1;i<=NF;i++){if($i ~ /^Device:/){sub(/^Device: /,\"\",$i);dev=$i} else if($i ~ /^Ethernet Address:/){sub(/^Ethernet Address: /,\"\",$i);mac=$i}} if(dev!=\"\"){ip=\"\"; st=\"\"; cmd=\"ipconfig getifaddr \" dev \" 2>/dev/null\"; cmd|getline ip; close(cmd); if(ip==\"\")ip=\"no IPv4\"; cmd=\"ifconfig \" dev \" 2>/dev/null\"; while((cmd|getline line)>0){if(line ~ /status:/){sub(/^.*status: /,\"\",line); st=line; break}} close(cmd); if(st==\"\")st=\"unknown\"; printf \"\\033[1;95mWi-Fi\\033[0m \\033[96m(%s)\\033[0m: %s [%s] - (%s)\\n\",dev,ip,st,mac; found=1}} END{if(!found) printf \"\\033[1;95mWi-Fi\\033[0m: No Wi-Fi device found\\n\"}'"
56 },
57
58 {
59 "type": "wifi",
60 "key": "SSID"
61 },
62
63 {
64 "type": "publicip",
65 "key": "Public IP"
66 },
67
68 {
69 "type": "bluetoothradio",
70 "key": "Bluetooth Radio",
71 "format": "{name} - {vendor} - Bluetooth {version}"
72 },
73
74 {
75 "type": "bluetooth",
76 "key": "Bluetooth Device",
77 "showDisconnected": true,
78 "format": "{name} [{address}] - connected: {connected}"
79 },
80
81 "locale",
82 "break",
83 "colors"
84 ]
85}
86