This commit is contained in:
Daylin Morgan 2022-04-29 10:36:13 -05:00
parent 856a7f78e2
commit b0e456cc90
4 changed files with 131 additions and 4 deletions

94
bin/welcome.py Executable file
View file

@ -0,0 +1,94 @@
#!/usr/bin/env python3
from rich.console import Console
from rich.text import Text
import argparse
console = Console(force_terminal=True)
colors = [
"black",
"red",
"green",
"yellow",
"blue",
"magenta",
"cyan",
"white",
"bright_black",
"bright_red",
"bright_green",
"bright_yellow",
"bright_blue",
"bright_magenta",
"bright_cyan",
"bright_white",
]
def wave():
"""
"""
lines = ["╮╭╭╮╮╭╭╮╮╭╭╮╮╭╭╮", "╰╯╯╰╰╯╯╰╰╯╯╰╰╯╯╰"]
for line in lines:
styled_line = [
Text(line[i * 2 : i * 2 + 2], style=color)
for i, color in enumerate(colors[:8])
]
console.print(Text("").join(styled_line))
def dots():
"""
"""
console.print(Text(" ").join([Text("", style=color) for color in colors[:8]]))
def wave_w_dots():
"""
Alternating colors from red to white with
black separators
"""
lines = ["╮╮●╭╭╭─╮╮╮●╭╭╭─╮╮╮●╭╭╭─╮╮╮●╭╭", "╰╰─╯╯╯●╰╰╰─╯╯╯●╰╰╰─╯╯╯●╰╰╰─╯╯"]
for line in lines:
styled_line = []
for i, x in enumerate(line):
if i % 4:
styled_line.append(Text(x, style=colors[1 + int(i / 4)]))
else:
styled_line.append(Text(x, style="black"))
console.print(Text("").join(styled_line))
def main():
prompts = {"wave": wave, "dots": dots, "wave_w_dots": wave_w_dots}
parser = argparse.ArgumentParser(
description="generate ansi color coded login prompts'"
)
parser.add_argument("--welcome", type=str, help="a welcome screen to print")
args = parser.parse_args()
if not args.welcome:
for name, prompt in prompts.items():
console.print(f"name: {name}")
prompt()
elif args.welcome not in prompts.keys():
console.print(f"{args.welcome} is not a registered prompt")
else:
prompts[args.welcome]()
if __name__ == "__main__":
main()

View file

@ -0,0 +1,23 @@
#!/usr/bin/env python3
print("\\033[XXm")
for i in range(30,37+1):
print("\033[%dm%d\t\t\033[%dm%d" % (i,i,i+60,i+60))
print("\\033[39m\\033[49m - Reset colour")
print("\\033[2K - Clear Line")
print("\\033[<L>;<C>H OR \\033[<L>;<C>f puts the cursor at line L and column C.")
print("\\033[<N>A Move the cursor up N lines")
print("\\033[<N>B Move the cursor down N lines")
print("\\033[<N>C Move the cursor forward N columns")
print("\\033[<N>D Move the cursor backward N columns")
print("\\033[2J Clear the screen, move to (0,0)")
print("\\033[K Erase to end of line")
print("\\033[s Save cursor position")
print("\\033[u Restore cursor position")
print()
print("\\032[4m Underline on")
print("\\033[24m Underline off")
print("\\033[1m Bold on")
print("\\033[21m Bold off")

View file

@ -57,7 +57,7 @@ if is-executable fnm; then
fi
if is-executable bat; then
export BAT_THEME=Dracula
export BAT_THEME=Catppuccin
export BAT_STYLE=header,numbers,grid
fi

View file

@ -6,11 +6,21 @@
# ------------
source "$HOME/.fzf/shell/key-bindings.zsh"
# dracula
# FZF_COLORS="
# --color=dark
# --color=fg:-1,bg:-1,hl:#5fff87,fg+:-1,bg+:-1,hl+:#ffaf5f
# --color=info:#af87ff,prompt:#5fff87,pointer:#ff87d7,marker:#ff87d7,spinner:#ff87d7
# "
# catppuccin
FZF_COLORS="
--color=dark
--color=fg:-1,bg:-1,hl:#5fff87,fg+:-1,bg+:-1,hl+:#ffaf5f
--color=info:#af87ff,prompt:#5fff87,pointer:#ff87d7,marker:#ff87d7,spinner:#ff87d7
--color=bg+:#302D41,bg:#1E1E2E,spinner:#F8BD96,hl:#F28FAD
--color=fg:#D9E0EE,header:#F28FAD,info:#DDB6F2,pointer:#F8BD96
--color=marker:#F8BD96,fg+:#F2CDCD,prompt:#DDB6F2,hl+:#F28FAD
"
FZF_LAYOUT="
--height=40%
--border=rounded