mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-22 20:13:30 +08:00
commit
13f656c720
40
themes/jacaetevha/fish_prompt.fish
Normal file
40
themes/jacaetevha/fish_prompt.fish
Normal file
|
@ -0,0 +1,40 @@
|
|||
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
|
||||
printf ' at '
|
||||
|
||||
set_color magenta
|
||||
printf '%s' (hostname|cut -d . -f 1)
|
||||
set_color normal
|
||||
printf ' in '
|
||||
|
||||
set_color $fish_color_cwd
|
||||
printf '%s ' (prompt_pwd)
|
||||
set_color blue
|
||||
printf '%s' (tbytes)
|
||||
set_color normal
|
||||
printf '%s' (__fish_git_prompt)
|
||||
|
||||
# Line 2
|
||||
echo
|
||||
if test $VIRTUAL_ENV
|
||||
printf "(%s) " (set_color blue)(basename $VIRTUAL_ENV)(set_color normal)
|
||||
end
|
||||
printf '↪ '
|
||||
set_color normal
|
||||
end
|
||||
|
5
themes/jacaetevha/fish_right_prompt.fish
Normal file
5
themes/jacaetevha/fish_right_prompt.fish
Normal file
|
@ -0,0 +1,5 @@
|
|||
function fish_right_prompt -d "Write out the right prompt"
|
||||
set_color yellow
|
||||
date
|
||||
set_color normal
|
||||
end
|
Loading…
Reference in New Issue
Block a user