Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Can Conky display the size of a folder?

  1. #1
    Join Date
    Feb 2008
    Beans
    Hidden!
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Can Conky display the size of a folder?

    Just started experimenting with Conky and I am trying to get it to display the size of individual folders.

    I have a dual boot with XP and all my media is on the XP partition. To display the XP used/size i have this:

    ${offset 240}${color slate grey}XP: ${color }${fs_used /media/drv0}/${fs_size /media/drv0}
    ${offset 240}${fs_bar 3,100 /media/drv0}

    This shows 116GB/200GB. I now want to show the size of my document folders so for My Music I have done this:

    ${offset 240}${color slate grey}Music: ${color }${fs_used /media/drv0/Documents and Settings/Dave/My Documents/My Music}/${fs_size /media/drv0/Documents and Settings/Dave/My Documents/My Music}
    ${offset 240}${fs_bar 3,100 /media/drv0/Documents and Settings/Dave/My Documents/My Music}

    However this also shows 116GB/200GB but My Music folder only has 15GB in it. What do I need to do to get it to display the actual size of My Music, My Pictures and My Videos?

    (I've looked in other conky threads but they move so fast that my problem keeps getting overlooked)

  2. #2
    Join Date
    Oct 2008
    Location
    Manila, Philippines
    Beans
    3
    Distro
    Kubuntu 8.04 Hardy Heron

    Re: Can Conky display the size of a folder?

    Also have (several) dual-boots. In Kubuntu, the KDirStat utility really does a great job, quick too! The display is like an expandable tree format. So you can see info for a drive, then click on directories to expand and see the info for those. Great for seeing where to clean-out temp files (e.g. browser cache, old packages) and other cruft.

    HTH!

    Winthrop Yu

  3. #3
    Join Date
    Feb 2008
    Location
    United Kingdom
    Beans
    1,108
    Distro
    Ubuntu Jaunty Jackalope (testing)

    Re: Can Conky display the size of a folder?

    Quote Originally Posted by stormtrooprdave View Post
    Just started experimenting with Conky and I am trying to get it to display the size of individual folders.

    I have a dual boot with XP and all my media is on the XP partition. To display the XP used/size i have this:

    ${offset 240}${color slate grey}XP: ${color }${fs_used /media/drv0}/${fs_size /media/drv0}
    ${offset 240}${fs_bar 3,100 /media/drv0}

    This shows 116GB/200GB. I now want to show the size of my document folders so for My Music I have done this:

    ${offset 240}${color slate grey}Music: ${color }${fs_used /media/drv0/Documents and Settings/Dave/My Documents/My Music}/${fs_size /media/drv0/Documents and Settings/Dave/My Documents/My Music}
    ${offset 240}${fs_bar 3,100 /media/drv0/Documents and Settings/Dave/My Documents/My Music}

    However this also shows 116GB/200GB but My Music folder only has 15GB in it. What do I need to do to get it to display the actual size of My Music, My Pictures and My Videos?

    (I've looked in other conky threads but they move so fast that my problem keeps getting overlooked)

    When you have this /home/tom/Desktop/Apple Orange it will not work, due to a space, you need this:

    /home/tom/Desktop/Apple\ Orange
    That will now work.

    HP Pavilion DV3505ea Laptop: Intel Core 2 Duo T5800 @ 2.0Ghz - 2GB RAM - 160GB HDD - nVidia GeForce 9300M GS - Intel 5100AGN Wireless

  4. #4
    Join Date
    Sep 2007
    Location
    KCMO
    Beans
    210
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Can Conky display the size of a folder?

    Just a stab in the dark on my part, but I don't think the normal fs_bar and such on Conky will work for a single folder, seeing as the folder is not a partition in itself. In which case, it'll default to reading the size and capacity and such of the partition the folder is located on.
    Desktop: Custom - AMD Athlon X4 Quadcore 4.02GHz, 8GB DDR3, 750GB HDD, 500GB HDD, Win7 x64/Ubuntu 14.04 x64
    Laptop: Thinkpad T61 - Intel Core 2 Duo 2.00GHz, 4GB DDR2, 500GB HDD, Win7 x86/Ubuntu 14.04 x86

  5. #5
    Join Date
    Aug 2008
    Location
    Bengaluru
    Beans
    157
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Can Conky display the size of a folder?

    Don't know about Conky. Would inotify help ?
    Debugging tip:
    When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
    --- Sherlock Holmes.

  6. #6
    Join Date
    Feb 2008
    Beans
    Hidden!
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Can Conky display the size of a folder?

    Quote Originally Posted by Tom--d View Post
    When you have this /home/tom/Desktop/Apple Orange it will not work, due to a space, you need this:

    /home/tom/Desktop/Apple\ Orange
    That will now work.
    Still could not get it to work despite a hundred different permutations of backslashes and quotation marks.

    In the terminal I did get the following command to display the directory size:

    du -sh /media/drv0/Documents\ and\ Settings/Dave/My\ Documents/My\ Music

    Can this be used in conky?
    Last edited by stormtrooprdave; October 12th, 2008 at 04:37 PM.

  7. #7
    Join Date
    Feb 2008
    Beans
    Hidden!
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Can Conky display the size of a folder?

    I got it to display the size of the folder using the execi du -sh command but it displays as:

    16G /media/drv0/Documents\ and\ Settings/Dave/My\ Documents/My\ Music

    This messes up my layout and looks terrible, plus there would be no bar to go with it.

    I know the information is there because if i right click properties on the folder it says Contents 15.5GB and Free Space 83.5GB, I just need to know how to get this displayed in conky?

  8. #8
    Join Date
    Oct 2008
    Beans
    1

    Thumbs down Re: Can Conky display the size of a folder?

    I've been mucking about with this to try and do the same and I think this might be the best way...

    du -sh your directory here | awk '{print $1}'

    as we only need the first column so awk can cut everything else out

    Mike
    (complete beginner, just learnt about pipes and stuff recently )

    EDIT: New thought for today... to get the bar use $execibar du -sh your directory here | awk '{print $1}' | tr -d A-Za-z to get rid of the letter at the end (then you'll have a number for a bar). Next problem though will be it won't care about Mb, Gb etc - not tried personally yet
    Last edited by splat_ed; October 15th, 2008 at 03:33 PM. Reason: More info added

  9. #9
    Join Date
    Feb 2008
    Beans
    Hidden!
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Can Conky display the size of a folder?

    Quote Originally Posted by splat_ed View Post
    I've been mucking about with this to try and do the same and I think this might be the best way...

    du -sh your directory here | awk '{print $1}'

    as we only need the first column so awk can cut everything else out

    Mike
    (complete beginner, just learnt about pipes and stuff recently )

    EDIT: New thought for today... to get the bar use $execibar du -sh your directory here | awk '{print $1}' | tr -d A-Za-z to get rid of the letter at the end (then you'll have a number for a bar). Next problem though will be it won't care about Mb, Gb etc - not tried personally yet
    Thanks for your help - the first command worked great and just displayed the numerical size of the folder.

    I couldnt get the bar to work though - it came up with this error:

    sh: Syntax error: Missing '}'

  10. #10
    Join Date
    Nov 2007
    Beans
    19

    Re: Can Conky display the size of a folder?

    I'm having this problem even while staying within the linux side

    root: ${fs_used_perc /}% ${fs_bar 6 /}
    home: ${fs_used_perc /home/emorris}% ${fs_bar 6 /home/emorris}

    Both show the same 14%, no idea why.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •