Files
dotfiles/bin/actions/hello.py
Menno van Leeuwen 62954eb986
Some checks failed
Nix Format Check / check-format (push) Failing after 37s
feat: remove deprecated shell scripts and add Python alternatives for all of them
2025-03-10 15:48:33 +01:00

31 lines
768 B
Python
Executable File

#!/usr/bin/env python3
import os
import sys
# Import helper functions
sys.path.append(os.path.join(os.path.expanduser("~/.dotfiles"), "bin"))
from helpers.functions import printfe, logo, _rainbow_color
def welcome():
"""Display welcome message with hostname and username"""
print()
# Get hostname and username
hostname = os.uname().nodename
username = os.environ.get("USER", os.environ.get("USERNAME", "user"))
print("\033[36mYou're logged in on [", end="")
print(_rainbow_color(hostname), end="")
print("\033[36m] as [", end="")
print(_rainbow_color(username), end="")
print("\033[36m]\033[0m")
def main():
logo(continue_after=True)
welcome()
return 0
if __name__ == "__main__":
sys.exit(main())