diff --git a/.gitignore b/.gitignore index 65db9c5..53b1e7e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .main.py.swp +test.py diff --git a/main.py b/main.py index e34654a..3be65a6 100755 --- a/main.py +++ b/main.py @@ -5,13 +5,14 @@ try: from pyfiglet import figlet_format except ImportError: - print('Error, module pyfiglet is required. Run: pip3 install pyfiglet') + print('Error, module pyfiglet is required. Run: sudo pip3 install pyfiglet') # VARIABLES -padding = [0, 0, 0, 0] -font_name = '3x5' +padding = [1, 0, 0, 3] +font_name = '3x5' custom_char_replace = {'#': '\u2588'} -time_format = '%H:%M:%S' +time_format = '%H:%M:%S' +update_frequency = 1 while True: # Clear the screen to make the clock appear 'in-place' @@ -19,7 +20,7 @@ # Convert the current time to the defined format time_string = datetime.datetime.now().strftime(time_format) - + # Turn the string into a figlet ASCII art string figlet_string = figlet_format(time_string, font=font_name) @@ -27,8 +28,19 @@ for char in custom_char_replace: figlet_string = figlet_string.replace(char, custom_char_replace[char]) + # Apply padding + # Top padding + for i in range(padding[0]): + print() + + # Right padding (useless until text alignment added) + # Bottom padding (pretty much useless as well) + # Left padding + for i in range(padding[3]): + figlet_string.replace('\n', '\n ') + # Print the string print(figlet_string) # Sleep - time.sleep(1) + time.sleep(update_frequency)