Added Libc information
This commit is contained in:
parent
0e2631d5b0
commit
f3a016b674
@ -5,6 +5,7 @@ echo -e "${C3}Hostname: ${C4}$(cat /etc/hostname)"
|
||||
echo -e "${C3}Kernel: ${C4}$(uname -s) $(uname -r)"
|
||||
echo -e "${C3}Packages: ${C4}$(get_packages)"
|
||||
echo -e "${C3}Shell: ${C4}${USER_SHELL}"
|
||||
echo -e "${C3}Libc: ${C4}${LIBC}"
|
||||
if [ ! -z "$CPU_MODEL" ]; then echo -e "${C3}CPU: ${C4}${CPU_MODEL} (${CPU_THREADS} threads)"; fi
|
||||
for i in $(seq ${CONNECTED_GPUS}); do
|
||||
gpu="GPU$i"
|
||||
|
1
main.go
1
main.go
@ -143,6 +143,7 @@ func SetupFetchEnv() []string {
|
||||
env["DE_WM"] = GetDEWM()
|
||||
env["USER_SHELL"] = GetShell()
|
||||
env["DISPLAY_PROTOCOL"] = GetDisplayProtocol()
|
||||
env["LIBC"] = GetLibc()
|
||||
monitors := getMonitorResolution()
|
||||
if len(monitors) != 0 {
|
||||
env["CONNECTED_MONITORS"] = strconv.Itoa(len(monitors))
|
||||
|
18
utils.go
18
utils.go
@ -394,6 +394,24 @@ func getMountedPartitions() []partition {
|
||||
return partitions
|
||||
}
|
||||
|
||||
func GetLibc() string {
|
||||
cmd := exec.Command("/bin/bash", "-c", "find /usr/lib64/ -maxdepth 1 -name 'ld-*' | grep musl")
|
||||
if err := cmd.Run(); err != nil {
|
||||
cmd = exec.Command("/bin/bash", "-c", "ldd --version | head -1 | cut -d' ' -f4")
|
||||
bytes, err := cmd.Output()
|
||||
if err != nil {
|
||||
return "Glibc"
|
||||
}
|
||||
return "Glibc " + strings.TrimSpace(string(bytes))
|
||||
}
|
||||
cmd = exec.Command("/bin/bash", "-c", "ldd 2>&1 | grep 'Version' | cut -d' ' -f2")
|
||||
bytes, err := cmd.Output()
|
||||
if err != nil {
|
||||
return "Musl"
|
||||
}
|
||||
return "Musl " + strings.TrimSpace(string(bytes))
|
||||
}
|
||||
|
||||
func FormatBytes(bytes uint64) string {
|
||||
var suffixes [6]string
|
||||
suffixes[0] = "B"
|
||||
|
Loading…
x
Reference in New Issue
Block a user