{ "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", "display": { "separator": ": ", "showErrors": false }, "modules": [ "title", "separator", // Detail macOS Tahoe. { "type": "command", "key": "OS Detail", "text": "printf '%s %s (Build %s) %s\\n' \"$(sw_vers -productName)\" \"$(sw_vers -productVersion)\" \"$(sw_vers -buildVersion)\" \"$(uname -m)\"" }, "host", "kernel", "uptime", "packages", "shell", "terminal", // Akun manusia macOS biasanya memiliki UniqueID >= 501. { "type": "command", "key": "User Accounts", "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 \"\"}'" }, "cpu", "gpu", "memory", "swap", { "type": "disk", "key": "Disk" }, // Ethernet macOS. // splitLines membuat setiap interface menjadi sub-module Fastfetch tersendiri, // sehingga alignment-nya rapi seperti module Bluetooth. { "type": "command", "key": "Ethernet", "splitLines": true, "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\"}'" }, // Wi-Fi macOS: label ditangani Fastfetch agar mengikuti alignment module lain. { "type": "command", "key": "Wi-Fi", "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\"}'" }, { "type": "wifi", "key": "SSID" }, { "type": "publicip", "key": "Public IP" }, { "type": "bluetoothradio", "key": "Bluetooth Radio", "format": "{name} - {vendor} - Bluetooth {version}" }, { "type": "bluetooth", "key": "Bluetooth Device", "showDisconnected": true, "format": "{name} [{address}] - connected: {connected}" }, "locale", "break", "colors" ] }