Created attachment 9085 Properties window with "size on disk" of explorer I believe it would be useful to users of Thunar to have a "size on disk" ability incorporated into Thunar itself. "Size on disk" is a feature explorer has (windows) which shows the real size the selected files are taking on disk. (see attachment) I believe it makes sense for Thunar to incorporate a "size on disk" for file systems that support compression and equivalent where files may take a larger portion in the storage than their respective size. In my knowledge only AFS, BtrFS, HFS+, JFS, NTFS and zfs support transparent compression. I only know how to get the "size on disk" for btrfs but I believe someone can come up with an algorithm for the others. As such, I believe it should be easy enough to plugin ways of getting the size on disk into Thunar's details window. As for btrfs. The steps, unfortunately, requires superuser; fortunately, this code can run in C and making use of setuid(). The steps are: ioctl() call: https://github.com/kilobyte/compsize/blob/master/compsize.c#L193 calculations to get the values here: https://github.com/kilobyte/compsize/blob/master/compsize.c#L201-225 final calculations here: https://github.com/kilobyte/compsize/blob/master/compsize.c#L118-178 radix tree used for calculations: https://github.com/kilobyte/compsize/blob/master/radix-tree.c The license of that code above is GPLv2. The rest of the code is UI. How feasible is such feature on Thunar?
Sorry, it does not sound good to me to introduce a feature which only can be used as superuser, and on top only possibly could be of any use for a small fraction of people, running specific filesystems. ( Not to mention that the "size on disk" most times will be nearly the same than the "size" ) If there is a way to get "size on disk" without superuser powers, we can talk again :) Best write a custom-action for your use-case .. we could than show it here: https://docs.xfce.org/xfce/thunar/custom-actions Or, if you want to go advanced, you can add an additional tab to the properties dialog by writing a thunar-plugin. (e.g. RabbitVCS does so)
I want to go advanced. Where can I find documentation on how to add a tab to properties with content the way I want? I was looking at the source code of media tags plugin but I didn't fully get how to use thunarx.
media tags plugin is a nice starting point. Looks like you need to implement the interface THUNARX_TYPE_PROPERTY_PAGE_PROVIDER (See https://git.xfce.org/thunar-plugins/thunar-media-tags-plugin/tree/thunar-plugin/media-tags-provider.c#n59 ) Not sure if it is required to as well implement the THUNARX_TYPE_RENAMER_PROVIDER ... probably the first one is sufficient. If you dont know how to start, just checkout the media tags plugin, rename it relevant parts, and modify it until it fits your needs / drop anything you dont need. ( Actually I never did thunar plugin development ... thats new for me as well ;) )