mirror of
https://github.com/EnumeratedDev/stormfetch.git
synced 2026-09-15 23:46:12 +00:00
Fixed minor bug and updated fetch_script.sh
Fixed bug which would cause partitions not to show up if /dev/disk/by-partlabel/ did not exist Updated fetch_script.sh to use labels if available
This commit is contained in:
@@ -11,9 +11,14 @@ if [ ! -z "$MEM_TOTAL" ] && [ ! -z "$MEM_USED" ]; then echo -e "${C3}Memory: ${C
|
|||||||
for i in $(seq ${MOUNTED_PARTITIONS}); do
|
for i in $(seq ${MOUNTED_PARTITIONS}); do
|
||||||
device="PARTITION${i}_DEVICE"
|
device="PARTITION${i}_DEVICE"
|
||||||
mountpoint="PARTITION${i}_MOUNTPOINT"
|
mountpoint="PARTITION${i}_MOUNTPOINT"
|
||||||
|
label="PARTITION${i}_LABEL"
|
||||||
total="PARTITION${i}_TOTAL_SIZE"
|
total="PARTITION${i}_TOTAL_SIZE"
|
||||||
used="PARTITION${i}_USED_SIZE"
|
used="PARTITION${i}_USED_SIZE"
|
||||||
echo -e "${C3}${!mountpoint}: ${C4}${!used}/${!total}"
|
if [ -z "${!label}" ]; then
|
||||||
|
echo -e "${C3}Partition ${!mountpoint}: ${C4}${!used}/${!total}"
|
||||||
|
else
|
||||||
|
echo -e "${C3}Partition ${!label}: ${C4}${!used}/${!total}"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
if [ ! -z "$DISPLAY_PROTOCOL" ]; then
|
if [ ! -z "$DISPLAY_PROTOCOL" ]; then
|
||||||
echo -e "${C3}Display Protocol: ${C4}${DISPLAY_PROTOCOL}"
|
echo -e "${C3}Display Protocol: ${C4}${DISPLAY_PROTOCOL}"
|
||||||
@@ -22,4 +27,4 @@ if [ ! -z "$DISPLAY_PROTOCOL" ]; then
|
|||||||
echo -e "${C3}Screen $i: ${C4}${!monitor}"
|
echo -e "${C3}Screen $i: ${C4}${!monitor}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
if [ ! -z "$DE_WM" ]; then echo -e "${C3}DE/WM: ${C4}${DE_WM}"; fi
|
if [ ! -z "$DE_WM" ]; then echo -e "${C3}DE/WM: ${C4}${DE_WM}"; fi
|
||||||
|
|||||||
@@ -336,7 +336,7 @@ func getMountedPartitions() []partition {
|
|||||||
}
|
}
|
||||||
|
|
||||||
partlabels, err := os.ReadDir("/dev/disk/by-partlabel")
|
partlabels, err := os.ReadDir("/dev/disk/by-partlabel")
|
||||||
if err != nil {
|
if err != nil && !os.IsNotExist(err) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
labels := make(map[string]string)
|
labels := make(map[string]string)
|
||||||
|
|||||||
Reference in New Issue
Block a user