Conky hard disk info  [Solved]

Message
Author
Mjaakko
Posts: 34
Joined: Mon Jul 10, 2023 7:22 pm

Conky hard disk info

#1 Post 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}
Last edited by Mjaakko on Sat Sep 23, 2023 5:20 pm, edited 2 times in total.

User avatar
wdscharff
Posts: 1153
Joined: Mon Feb 24, 2020 1:07 am

Re: Conky hard disk info

#2 Post 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}
my working horse Desktop AMD Ryzen 9 3900x, 32GB Ram // SSD ... enough
mx-fluxbox, what else?

In nature there are neither rewards nor punishments.
There are consequences.


my wallpaper gallery

Mjaakko
Posts: 34
Joined: Mon Jul 10, 2023 7:22 pm

Re: Conky hard disk info

#3 Post 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:

Code: Select all

Storage: 386.94 GiB (78.5% used)
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
Last edited by Mjaakko on Thu Sep 21, 2023 8:29 am, edited 1 time in total.

User avatar
siamhie
Global Moderator
Posts: 3816
Joined: Fri Aug 20, 2021 5:45 pm

Re: Conky hard disk info

#4 Post 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
You do not have the required permissions to view the files attached to this post.
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

Mjaakko
Posts: 34
Joined: Mon Jul 10, 2023 7:22 pm

Re: Conky hard disk info

#5 Post by Mjaakko »

siamhie wrote: Sat Sep 16, 2023 4:27 pm I use this web site for all the code. http://ifxgroup.net/conky.htm#fs_bar
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}'}

User avatar
MikeR
Posts: 273
Joined: Sun Jun 25, 2023 6:42 am

Re: Conky hard disk info

#6 Post 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}
Old RSTS hack
Registered Linux user #542196

amlug
Posts: 42
Joined: Tue Jan 28, 2020 12:43 pm

Re: Conky hard disk info

#7 Post 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

Mjaakko
Posts: 34
Joined: Mon Jul 10, 2023 7:22 pm

Re: Conky hard disk info

#8 Post 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%)
Last edited by Mjaakko on Thu Sep 21, 2023 8:31 am, edited 1 time in total.

User avatar
wdscharff
Posts: 1153
Joined: Mon Feb 24, 2020 1:07 am

Re: Conky hard disk info

#9 Post 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
You do not have the required permissions to view the files attached to this post.
my working horse Desktop AMD Ryzen 9 3900x, 32GB Ram // SSD ... enough
mx-fluxbox, what else?

In nature there are neither rewards nor punishments.
There are consequences.


my wallpaper gallery

Mjaakko
Posts: 34
Joined: Mon Jul 10, 2023 7:22 pm

Re: Conky hard disk info

#10 Post 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?

Post Reply

Return to “Software / Configuration”