Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Shows the actual size of files in Thunar. Thunar has a strange problem of not reporting the correct size of files.
#! /bin/bash
kb=$((2**10))
mb=$((2**20))
for file in $@; do
if [ ! -e $file ]; then
continue
fi
b1=`ls -l $file | cut -d" " -f5`
let "b += b1"
done
k=`echo -e "scale=2; $b/$kb" | bc`
m=`echo -e "scale=2; $b/$mb" | bc`
zenity --info --title="Actual File Size" --width=300 --height=100 --text="$b bytes\n$k KB\n$m MB"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.