Skip to content

Instantly share code, notes, and snippets.

@jackwillis
Last active January 20, 2024 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackwillis/017b5b00ded6efbd738de64ca0527209 to your computer and use it in GitHub Desktop.
Save jackwillis/017b5b00ded6efbd738de64ca0527209 to your computer and use it in GitHub Desktop.
if status is-interactive
# Commands to run in interactive sessions can go here
end
status --is-login; and status --is-interactive; and exec byobu-launcher
function rainbowify
# Define a set of RGB colors for the rainbow
set colors '255;0;0' '255;69;0' '255;140;0' '255;165;0' '255;215;0' '255;255;0' '218;255;0' '140;255;0' '69;255;0' '0;255;0' '0;255;69' '0;255;140' '0;255;215' '0;255;255' '0;215;255' '0;140;255' '0;69;255' '0;0;255' '69;0;255' '140;0;255' '215;0;255' '255;0;255' '255;0;215' '255;0;140' '255;0;69'
set colored_text ''
set char_index 1
set colors_length (count $colors)
for char in (echo $argv | sed 's/\(.\)/\1\n/g')
set color_index (math "(($char_index - 1) % $colors_length) + 1")
set rgb $colors[$color_index]
set colored_text "$colored_text\033[38;2;"{$rgb}"m$char"
set char_index (math "$char_index + 1")
end
set colored_text "$colored_text\033[0m" # Reset color at the end
echo -e $colored_text
end
function fish_greeting
rainbowify "Bienvenido a "(hostname)", "(whoami)"!"
cowsay 'W3lc0M3 2 t3h B0tn3T! W3 l0V3 u!'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment