feat: remove deprecated shell scripts and add Python alternatives for all of them
Some checks failed
Nix Format Check / check-format (push) Failing after 37s
Some checks failed
Nix Format Check / check-format (push) Failing after 37s
This commit is contained in:
30
bin/actions/hello.py
Executable file
30
bin/actions/hello.py
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/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())
|
Reference in New Issue
Block a user