Skip to content

Instantly share code, notes, and snippets.

@Birchwell
Created October 18, 2015 00:00
Show Gist options
  • Save Birchwell/e1dcb5055cfea83b8f28 to your computer and use it in GitHub Desktop.
Save Birchwell/e1dcb5055cfea83b8f28 to your computer and use it in GitHub Desktop.
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