diff --git a/themes/jacaetevha/fish_prompt.fish b/themes/jacaetevha/fish_prompt.fish index d52d782..af72a00 100644 --- a/themes/jacaetevha/fish_prompt.fish +++ b/themes/jacaetevha/fish_prompt.fish @@ -1,7 +1,17 @@ -function fish_prompt - set -l script_dir (dirname (status -f)) - . $script_dir/tbytes.fish +function tbytes -d 'calculates the total size of the files in the current directory' + set -l tBytes (ls -al | grep "^-" | awk 'BEGIN {i=0} { i += $5 } END { print i }') + + if test $tBytes -lt 1048576 + set -g total (echo -e "scale=3 \n$tBytes/1048 \nquit" | bc) + set -g units " Kb" + else + set -g total (echo -e "scale=3 \n$tBytes/1048576 \nquit" | bc) + set -g units " Mb" + end + echo -n "$total$units" +end +function fish_prompt set_color yellow printf '%s' (whoami) set_color normal diff --git a/themes/jacaetevha/tbytes.fish b/themes/jacaetevha/tbytes.fish deleted file mode 100755 index 01f203b..0000000 --- a/themes/jacaetevha/tbytes.fish +++ /dev/null @@ -1,12 +0,0 @@ -function tbytes -d 'calculates the total size of the files in the current directory' - set -g tBytes (ls -al | grep "^-" | awk 'BEGIN {i=0} { i += $5 } END { print i }') - - if test $tBytes -lt 1048576 - set -g total (echo -e "scale=3 \n$tBytes/1048 \nquit" | bc) - set -g units " Kb" - else - set -g total (echo -e "scale=3 \n$tBytes/1048576 \nquit" | bc) - set -g units " Mb" - end - echo -n "$total$units" -end