Announcement

Collapse
No announcement yet.

How can I summarize free/used disk space in Conky?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How can I summarize free/used disk space in Conky?

    I want to summarize some of my separate partition and display the summarized free/used space.
    Am I able to do this with Conky?

    #2
    Originally posted by Joey Mendez View Post
    I want to summarize some of my separate partition and display the summarized free/used space.
    Am I able to do this with Conky?
    Code:
    df -h
    Might give you most of what you want.

    However, there is a plasmoid you could use!

    Comment


      #3
      It's just a list of my mounted file systems + seperate datas. How can I use this in Conky?
      For example I want similar to:
      ${fs_free /dev/sda1 + /dev/sda2 + /dev/sda3 + /dev/sda4}
      ${fs_used /dev/sda1 + /dev/sda2 + /dev/sda3 + /dev/sda4}
      but it doesn't work.

      Comment


        #4
        Well there is a plasmoid. If conky is your thing, you might get more luck on #conky on irc.freenode.net or their mailing list but hopefully a community member comes along to help. I can easily make a python script etc that outputs what you want. Could probably do it in bash too but I don't see it helping you. Hopefully another member helps you out. Loo at http://conky.sourceforge.net/variables.html It might help, but alas I don't know how to sum variables in conky.

        Comment


          #5
          What's the name of this plasmoid?

          Comment


            #6
            Here's a piece of the code from my conky that shows used and free space on four filesystems:

            Code:
            ${execp ~/conkygraphics.sh}${font}${color orange}
            ${font Terminus:style=bold:size=11}FILESYSTEMS $hr
            ${font Terminus:size=9}${color orange}/                     ${color white}${fs_used /} / ${fs_size /}${color grey}${alignr}${fs_bar 5,120 /}
            ${font Terminus:size=9}${color orange}REVODATA      ${color white}${fs_used /mnt/REVODATA} / ${fs_size /mnt/REVODATA}${color grey}${alignr}${fs_bar 5,120 /mnt/REVODATA}
            ${font Terminus:size=9}${color orange}SDA2              ${color white}${fs_used /mnt/SDA2} / ${fs_size /mnt/SDA2}${color grey}${alignr}${fs_bar 5,120 /mnt/SDA2}
            ${font Terminus:size=9}${color orange}DATA              ${color white}${fs_used /mnt/DATA} / ${fs_size /mnt/DATA}${color grey}${alignr}${fs_bar 5,120 /mnt/DATA}
            Last edited by dibl; Apr 22, 2013, 01:54 PM.

            Comment


              #7
              Originally posted by Joey Mendez View Post
              What's the name of this plasmoid?
              "Hard Disk Space Usage" its an unoriginal but descriptive name.

              Comment


                #8
                Originally posted by dmeyer View Post
                "Hard Disk Space Usage" its an unoriginal but descriptive name.
                I able to show the free/used space in this way in Conky. I want to show the whole disk (which separated to partitions) used/free space.

                Comment


                  #9
                  I have a couple options here if I understood your question. I used templates to achieve this.

                  Option 1:

                  Declare your templates above the TEXT section in your conky config.

                  Code:
                  #template0 (hdd) mountpoint fs_free
                  template0 ${color1}${fs_free}
                  
                  #template1 (hdd) mountpoint fs_used
                  template1 ${color1}${fs_used}
                  Call your templates in the TEXT section in your conky config. You can enter spaces to line up your columns for root, usr, var, tmp, and home. Substitute your mountpoints as needed.

                  Code:
                  ${color}       root       usr        var        tmp        home
                  free:  ${template0 /}    ${template0 /usr}    ${template0 /var}    ${template0 /tmp}    ${template0 /home}
                  used:  ${template1 /}    ${template1 /usr}    ${template1 /var}    ${template1 /tmp}    ${template1 /home}
                  This is the conky display.



                  Option 2:

                  Enter this above the TEXT section.

                  Code:
                  #template0 (hdd) mountpoint fs_free
                  template0 ${color1}\1 ${fs_free \2}
                  
                  #template1 (hdd) mountpoint fs_used
                  template1 ${color1}\1 ${fs_used \2}
                  Enter this in the TEXT section.

                  Code:
                  free:  ${template0 root /}  ${template0 usr /usr}  ${template0 var /var}  ${template0 tmp /tmp}  ${template0 home /home}
                  used:  ${template1 root /}  ${template1 usr /usr}  ${template1 var /var}  ${template1 tmp /tmp}  ${template1 home /home}
                  This is the conky display. Unfortunately it makes for a very wide conky.


                  I'm sure there must be more efficient ways of acheiving this.
                  Hope this helps.
                  sigpic

                  Comment


                    #10
                    Dynamically monitor disk usage in conky

                    To dynamically monitor all mounted drives in my system I use the following in a script

                    Code:
                    cat /proc/mounts |  awk '{    if ( $1 ~ /\/dev/ ) 
                       {
                          num_elem = split($2,str_array,"/")
                          if (str_array[num_elem] == "")
                          {
                             str_array[num_elem] = "/";
                          }
                          printf "   ${color #98c2c7}%5.5s:$color  ${fs_used %s}  ${fs_free %s}  ${color #78af78}${fs_bar 6 %s}\n", str_array[num_elem], $2, $2, $2
                       }
                    }'
                    I then call the srcript with this in my .conkyrc

                    Code:
                    ${execpi 30 script}

                    Comment

                    Working...
                    X