Dernière activité 1788248311

config.jsonc Brut
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 // splitLines membuat setiap interface menjadi sub-module Fastfetch tersendiri,
46 // sehingga alignment-nya rapi seperti module Bluetooth.
47 {
48 "type": "command",
49 "key": "Ethernet",
50 "splitLines": true,
51 "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[96m(%s)\\033[0m: %s [\\033[32m%s\\033[0m] - (%s)\\n\",dev,ip,st,mac; found=1}} END{if(!found) printf \"No Ethernet device found\\n\"}'"
52 },
53
54 // Wi-Fi macOS: label ditangani Fastfetch agar mengikuti alignment module lain.
55 {
56 "type": "command",
57 "key": "Wi-Fi",
58 "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)\\n\",dev,ip,st,mac; found=1}} END{if(!found) printf \"No Wi-Fi device found\\n\"}'"
59 },
60
61 {
62 "type": "wifi",
63 "key": "SSID"
64 },
65
66 {
67 "type": "publicip",
68 "key": "Public IP"
69 },
70
71 {
72 "type": "bluetoothradio",
73 "key": "Bluetooth Radio",
74 "format": "{name} - {vendor} - Bluetooth {version}"
75 },
76
77 {
78 "type": "bluetooth",
79 "key": "Bluetooth Device",
80 "showDisconnected": true,
81 "format": "{name} [{address}] - connected: {connected}"
82 },
83
84 "locale",
85 "break",
86 "colors"
87 ]
88}