Page 1 of 3
Conky hard disk info
Posted: Sat Sep 16, 2023 5:29 am
by Mjaakko
How to show the size and used of total hard disk? I have many partitions, but this only shows current root and home.
Code: Select all
ROOT free: ${fs_free /} used: ${fs_used /} total: ${fs_size /}
HOME free: ${fs_free /home} used: ${fs_free /home} total: ${fs_size /home}
Re: Conky hard disk info
Posted: Sat Sep 16, 2023 8:06 am
by wdscharff
There are several variants of the conkys supplied.
For some, the script "semplice-conky-harddisks.sh".
then an example of how to integrate INXI, shortened to the device output (found with google search)
and then you can also do it yourself, by foot, for each drive individually, as is currently the case.
There are also enough examples in the www, google is very helpful.
Code: Select all
${font Open Sans:Bold:size=12}${color}mounted ${color0}${hr 2}$color$font$
${font Open Sans:size=12}Data ${goto 80}${fs_used /media/DATA} / ${fs_size /media/DATA} ${goto 220} ${color5}${fs_bar 8,250 /media/DATA}${color} ${goto 500}${fs_free_perc /media/DATA}% frei ${color} ${goto 580}I/O: ${color5}${diskio_read /dev/disk/by-label/DATA}${color} : ${color5}${diskio_write /dev/disk/by-label/DATA}${color}
${font Open Sans:size=12}evo850 ${goto 80}${fs_used /media/evo850} / ${fs_size /media/evo850} ${goto 220} ${color5}${fs_bar 8,250 /media/evo850}${color} ${goto 500}${fs_free_perc /media/evo850}% frei ${goto 580}I/O: ${color5}${diskio_read /dev/disk/by-label/evo850}${color} : ${color5}${diskio_write /dev/disk/by-label/evo850}${color}
Re: Conky hard disk info
Posted: Sat Sep 16, 2023 3:06 pm
by Mjaakko
wdscharff wrote: Sat Sep 16, 2023 8:06 am
then an example of how to integrate INXI, shortened to the device output (found with google search)
Inxi package is installed on MX and gives the total hard disk storage:
How to add in Conky, I found something like this....
Code: Select all
create small bash scripts that produce conky syntax, and then call them with
${execp /path/to/script}
https://forums.bunsenlabs.org/viewtopic.php?id=4984
Re: Conky hard disk info
Posted: Sat Sep 16, 2023 4:27 pm
by siamhie
I find it easier to point the directories to their locations instead of going through scripts.
Code: Select all
Root: ${fs_used /}${alignr}/${fs_size /}
Stream: ${fs_used /media/Stream/}${alignr}/${fs_size /media/Stream/}
Data: ${fs_used /media/Data/}${alignr}/${fs_size /media/Data/}
file_system.png
I use this web site for all the code.
http://ifxgroup.net/conky.htm#fs_bar
Re: Conky hard disk info
Posted: Sat Sep 16, 2023 6:43 pm
by Mjaakko
Thanks, that's interesting.
${execp cat hdd-storage.txt} works fine but is better if not sent to a text file but a direct command. This syntax Conky doesn't accept or I am missing something? The shell command is correct.
Code: Select all
${execp inxi | grep '^Storage:' | awk '{print $1 " " $2 " " $3 " " $4 " " $5}'}
Re: Conky hard disk info
Posted: Sun Sep 17, 2023 3:44 am
by MikeR
${color blue}${font LCDMono:bold:size=10}sdb${font}${if_match ""!="${execi 60 mount | grep /dev/sdb }"} \
(${execi 60 mount | grep 'sdb' | awk '{print $3}' | awk -F"/" '{print $3}'}) \
read/write: $color${diskio_read sdb}/${diskio_write sdb} ${else}${color red} Not Mounted ${endif}
Re: Conky hard disk info
Posted: Sun Sep 17, 2023 8:38 am
by amlug
Mjaakko wrote: Sat Sep 16, 2023 6:43 pm
This syntax Conky doesn't accept or I am missing something? The shell command is correct.
Conky is corrupting inxi output by adding strange characters.... one small horizontal triangle and number 12 (forum doesn't show the triangle)
12Storage 476.94 GiB (71.5% used)
12Procs 305
12Client Unknown Client: conky
12inxi 3.3.26
Re: Conky hard disk info
Posted: Sun Sep 17, 2023 3:33 pm
by Mjaakko
amlug wrote: Sun Sep 17, 2023 8:38 am
Conky is corrupting inxi output by adding strange characters....
That's bad either Conky or Inxi causing it. I like the clean and informative info of inxi, example
inxi -b
Drives:
Local Storage: total: 953.87 GiB used: 75.44 GiB (7.9%)
https://opensource.com/article/22/9/linux-inxi-command
I will add bash script until better idea.
Code: Select all
inxi -b | grep 'Local Storage:' > hdd-storage.txt
In Conky
Code: Select all
${execp cat hdd-storage.txt | sed 's/ Local Storage:/HDD/'}
Result:
Code: Select all
HDD total: 386.94 GiB used: 322.05 GiB (83.1%)
Re: Conky hard disk info
Posted: Mon Sep 18, 2023 4:45 am
by wdscharff
so i still find my variant attractive, even though it's a lot to write myself.
Once done, done. There are more drives in there, but they are commented out because they are not connected.
Above all, I decide how it looks, in terms of colour, font and display bars.
mounted.jpg
Re: Conky hard disk info
Posted: Mon Sep 18, 2023 11:30 am
by Mjaakko
wdscharff wrote: Mon Sep 18, 2023 4:45 am
so i still find my variant attractive, even though it's a lot to write myself.
Looks great.
I want information that shows storage capacity and current use of my Hard Disk. Is the
Total/use: 243 GIB / 31,1 GIB capacity of your Hard Disk? If so, what's the Conky syntax?