change disk storage display

pull/6/head
axtloss 2 years ago
parent ead0e4af54
commit 324495e7a3

@ -1,2 +1,2 @@
#!/usr/bin/bash #!/usr/bin/bash
flatpak-spawn --host lsblk -pdo SIZE $1 | grep -v SIZE flatpak-spawn --host lsblk -pdbo SIZE $1 | grep -v SIZE

@ -17,7 +17,7 @@
# #
# SPDX-License-Identifier: GPL-3.0-only # SPDX-License-Identifier: GPL-3.0-only
import subprocess import subprocess, math
def get_disks(): def get_disks():
command=subprocess.run(["bash", "-c", "bash -- /app/share/jade_gui/jade_gui/scripts/getDisks.sh"], capture_output=True) command=subprocess.run(["bash", "-c", "bash -- /app/share/jade_gui/jade_gui/scripts/getDisks.sh"], capture_output=True)
disks=command.stdout.decode('utf-8')[:-1].split('\n') disks=command.stdout.decode('utf-8')[:-1].split('\n')
@ -27,4 +27,4 @@ def get_disk_size(disk: str):
command=subprocess.run(["bash", "-c", "bash -- /app/share/jade_gui/jade_gui/scripts/getDiskSize.sh "+disk], capture_output=True) command=subprocess.run(["bash", "-c", "bash -- /app/share/jade_gui/jade_gui/scripts/getDiskSize.sh "+disk], capture_output=True)
size=command.stdout.decode('utf-8').strip('\n') size=command.stdout.decode('utf-8').strip('\n')
print(disk+":"+size) print(disk+":"+size)
return size+"iB" return str(math.floor(int(size)/1000**3))+" GB"

Loading…
Cancel
Save