最後活躍 1788248311

dartokloning's Avatar dartokloning 已修改 1788248311. 還原成這個修訂版本

1 file changed, 6 insertions, 5 deletions

config.jsonc

@@ -42,19 +42,20 @@
42 42 },
43 43
44 44 // Ethernet macOS.
45 - // Dibuat satu baris agar selalu mengikuti alignment Fastfetch dan tidak
46 - // memutus layout logo/module seperti output command multi-line.
45 + // splitLines membuat setiap interface menjadi sub-module Fastfetch tersendiri,
46 + // sehingga alignment-nya rapi seperti module Bluetooth.
47 47 {
48 48 "type": "command",
49 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\"}'"
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\"}'"
51 52 },
52 53
53 - // Wi-Fi macOS: key ditangani Fastfetch agar alignment konsisten.
54 + // Wi-Fi macOS: label ditangani Fastfetch agar mengikuti alignment module lain.
54 55 {
55 56 "type": "command",
56 57 "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 + "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\"}'"
58 59 },
59 60
60 61 {

dartokloning's Avatar dartokloning 已修改 1788248209. 還原成這個修訂版本

1 file changed, 6 insertions, 7 deletions

config.jsonc

@@ -42,20 +42,19 @@
42 42 },
43 43
44 44 // Ethernet macOS.
45 - // splitLines membuat setiap interface menjadi sub-module Fastfetch tersendiri,
46 - // sehingga alignment-nya rapi seperti module Bluetooth.
45 + // Dibuat satu baris agar selalu mengikuti alignment Fastfetch dan tidak
46 + // memutus layout logo/module seperti output command multi-line.
47 47 {
48 48 "type": "command",
49 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\"}'"
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\"}'"
52 51 },
53 52
54 - // Wi-Fi macOS: label ditangani Fastfetch agar mengikuti alignment module lain.
53 + // Wi-Fi macOS: key ditangani Fastfetch agar alignment konsisten.
55 54 {
56 55 "type": "command",
57 56 "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\"}'"
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\"}'"
59 58 },
60 59
61 60 {
@@ -85,4 +84,4 @@
85 84 "break",
86 85 "colors"
87 86 ]
88 - }
87 + }

dartokloning's Avatar dartokloning 已修改 1788246808. 還原成這個修訂版本

1 file changed, 9 insertions, 6 deletions

config.jsonc

@@ -41,18 +41,21 @@
41 41 "key": "Disk"
42 42 },
43 43
44 - // Ethernet macOS: hardware port, BSD interface, IPv4, status, MAC.
44 + // Ethernet macOS.
45 + // splitLines membuat setiap interface menjadi sub-module Fastfetch tersendiri,
46 + // sehingga alignment-nya rapi seperti module Bluetooth.
45 47 {
46 48 "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 + "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\"}'"
49 52 },
50 53
51 - // Wi-Fi macOS: cari hardware port Wi-Fi/AirPort lalu tampilkan interface/IP/MAC.
54 + // Wi-Fi macOS: label ditangani Fastfetch agar mengikuti alignment module lain.
52 55 {
53 56 "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\"}'"
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\"}'"
56 59 },
57 60
58 61 {

dartokloning's Avatar dartokloning 已修改 1788244585. 還原成這個修訂版本

1 file changed, 2 insertions, 2 deletions

config.jsonc

@@ -45,14 +45,14 @@
45 45 {
46 46 "type": "command",
47 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!=\"\"){cmd=\"ipconfig getifaddr \" dev \" 2>/dev/null\"; cmd|getline ip; close(cmd); if(ip==\"\")ip=\"no IPv4\"; cmd=\"ifconfig \" dev \" 2>/dev/null | awk \\\'/status:/{print $2; exit}\\\'\"; cmd|getline st; 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\"}'"
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 49 },
50 50
51 51 // Wi-Fi macOS: cari hardware port Wi-Fi/AirPort lalu tampilkan interface/IP/MAC.
52 52 {
53 53 "type": "command",
54 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!=\"\"){cmd=\"ipconfig getifaddr \" dev \" 2>/dev/null\"; cmd|getline ip; close(cmd); if(ip==\"\")ip=\"no IPv4\"; cmd=\"ifconfig \" dev \" 2>/dev/null | awk \\\'/status:/{print $2; exit}\\\'\"; cmd|getline st; 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\"}'"
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 56 },
57 57
58 58 {

dartokloning's Avatar dartokloning 已修改 1788242016. 還原成這個修訂版本

1 file changed, 85 insertions

config.jsonc(檔案已創建)

@@ -0,0 +1,85 @@
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!=\"\"){cmd=\"ipconfig getifaddr \" dev \" 2>/dev/null\"; cmd|getline ip; close(cmd); if(ip==\"\")ip=\"no IPv4\"; cmd=\"ifconfig \" dev \" 2>/dev/null | awk \\\'/status:/{print $2; exit}\\\'\"; cmd|getline st; 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!=\"\"){cmd=\"ipconfig getifaddr \" dev \" 2>/dev/null\"; cmd|getline ip; close(cmd); if(ip==\"\")ip=\"no IPv4\"; cmd=\"ifconfig \" dev \" 2>/dev/null | awk \\\'/status:/{print $2; exit}\\\'\"; cmd|getline st; 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 + }
上一頁 下一頁