Spaces:
Sleeping
Sleeping
Download display.py from Aravindhan11/AI_Code_Terminal: direct link, hf CLI and curl.
- Browser
- Download file 1.54 kB
-
https://huggingface.co/spaces/Aravindhan11/AI_Code_Terminal/resolve/main/display.py
- Command line
-
hf download hf://spaces/Aravindhan11/AI_Code_Terminal/display.py
-
curl -L -o display.py https://huggingface.co/spaces/Aravindhan11/AI_Code_Terminal/resolve/main/display.py
1.54 kB
| # display.py | |
| import os | |
| import getpass | |
| import socket | |
| from datetime import datetime | |
| from colors import * | |
| def clear_and_setup(): | |
| """Clear terminal and setup background""" | |
| os.system('clear') | |
| print(BG_BLACK, end='') | |
| print(f"{CYAN}{BOLD}") | |
| print(" ╔═══════════════════════════════════════╗") | |
| print(" ║ Codic ║") | |
| print(" ║ Your Custom Shell ║") | |
| print(" ╚═══════════════════════════════════════╝") | |
| print(f"{RESET}\n") | |
| def get_colored_prompt(): | |
| """Create colorful prompt with current path""" | |
| username = getpass.getuser() | |
| hostname = socket.gethostname() | |
| current_path = os.getcwd() | |
| if len(current_path) > 25: | |
| current_path = "..." + current_path[-22:] | |
| return f"{GREEN}{BOLD}{username}{RESET}@{BLUE}{hostname}{RESET}:{YELLOW}{BOLD}{current_path}{RESET}> AcidopShell$ " | |
| def show_ascii_art(): | |
| """Show cool ASCII art as background""" | |
| art = f"""{BLUE} | |
| ⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣶⣿⣿⣿⣿⣿⣶⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀ | |
| ⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀ | |
| ⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀⠀⠀⠀ | |
| ⠀⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀ | |
| {RESET}""" | |
| print(art) | |