mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-03 15:40:32 +00:00
add TBytes.sh
This commit is contained in:
parent
0b92a704e1
commit
0986a42450
18
themes/jacaetevha/TBytes.sh
Executable file
18
themes/jacaetevha/TBytes.sh
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#Sum the number of bytes in a directory listing
|
||||||
|
TBytes=0
|
||||||
|
# swap the next two lines in order to get a summary with the sizes of directories as well
|
||||||
|
#for Bytes in $(ls -l | awk '{ print $5 }')
|
||||||
|
for Bytes in $(ls -l | grep "^-" | awk '{ print $5 }')
|
||||||
|
do
|
||||||
|
let TBytes=$TBytes+$Bytes
|
||||||
|
done
|
||||||
|
|
||||||
|
Total=$(echo -e "scale=3 \n$TBytes/1048576 \nquit" | bc)
|
||||||
|
Units=" Mb"
|
||||||
|
if [[ TBytes -lt 1048576 ]]
|
||||||
|
then
|
||||||
|
Total=$(echo -e "scale=3 \n$TBytes/1048 \nquit" | bc)
|
||||||
|
Units=" Kb"
|
||||||
|
fi
|
||||||
|
echo -n "$Total$Units"
|
@ -1,27 +1,28 @@
|
|||||||
function fish_prompt
|
function fish_prompt
|
||||||
set_color yellow
|
set -l script_dir (dirname (status -f))
|
||||||
printf '%s' (whoami)
|
set_color yellow
|
||||||
set_color normal
|
printf '%s' (whoami)
|
||||||
printf ' at '
|
set_color normal
|
||||||
|
printf ' at '
|
||||||
|
|
||||||
set_color magenta
|
set_color magenta
|
||||||
printf '%s' (hostname|cut -d . -f 1)
|
printf '%s' (hostname|cut -d . -f 1)
|
||||||
set_color normal
|
set_color normal
|
||||||
printf ' in '
|
printf ' in '
|
||||||
|
|
||||||
set_color $fish_color_cwd
|
set_color $fish_color_cwd
|
||||||
printf '%s ' (prompt_pwd)
|
printf '%s ' (prompt_pwd)
|
||||||
set_color blue
|
set_color blue
|
||||||
printf '%s' (/Users/jrogers/bin/TBytes.sh)
|
printf '%s' ($script_dir/TBytes.sh)
|
||||||
set_color normal
|
set_color normal
|
||||||
printf '%s' (__fish_git_prompt)
|
printf '%s' (__fish_git_prompt)
|
||||||
|
|
||||||
# Line 2
|
# Line 2
|
||||||
echo
|
echo
|
||||||
if test $VIRTUAL_ENV
|
if test $VIRTUAL_ENV
|
||||||
printf "(%s) " (set_color blue)(basename $VIRTUAL_ENV)(set_color normal)
|
printf "(%s) " (set_color blue)(basename $VIRTUAL_ENV)(set_color normal)
|
||||||
end
|
end
|
||||||
printf '↪ '
|
printf '↪ '
|
||||||
set_color normal
|
set_color normal
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user