最後活躍 1788248311

修訂 4fda4fdd8dc5872cb58cf81a008cb54f92e1e4bf

config.jsonc 原始檔案
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.
45 // Dibuat satu baris agar selalu mengikuti alignment Fastfetch dan tidak
46 // memutus layout logo/module seperti output command multi-line.
47 {
48 "type": "command",
49 "key": "Ethernet",
50 "text": "networksetup -listallhardwareports 2>/dev/null | awk 'BEGIN{RS=\"\"; FS=\"\\n\"} /Hardware Port: (Ethernet|Thunderbolt Ethernet|USB.*LAN|LAN)/ {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\"; if(found) printf \" | \"; printf \"\\033[96m(%s)\\033[0m %s [\\033[32m%s\\033[0m] - (%s)\",dev,ip,st,mac; found=1}} END{if(!found) printf \"No Ethernet device found\"}'"
51 },
52
53 // Wi-Fi macOS: key ditangani Fastfetch agar alignment konsisten.
54 {
55 "type": "command",
56 "key": "Wi-Fi",
57 "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[96m(%s)\\033[0m %s [%s] - (%s)\",dev,ip,st,mac; found=1}} END{if(!found) printf \"No Wi-Fi device found\"}'"
58 },
59
60 {
61 "type": "wifi",
62 "key": "SSID"
63 },
64
65 {
66 "type": "publicip",
67 "key": "Public IP"
68 },
69
70 {
71 "type": "bluetoothradio",
72 "key": "Bluetooth Radio",
73 "format": "{name} - {vendor} - Bluetooth {version}"
74 },
75
76 {
77 "type": "bluetooth",
78 "key": "Bluetooth Device",
79 "showDisconnected": true,
80 "format": "{name} [{address}] - connected: {connected}"
81 },
82
83 "locale",
84 "break",
85 "colors"
86 ]
87}