Browse Source

[+] Clear screen feature

Azalea (on HyDEV-Daisy) 3 years ago
parent
commit
892ed4e141
1 changed files with 7 additions and 0 deletions
  1. 7 0
      hyfetch/color_util.py

+ 7 - 0
hyfetch/color_util.py

@@ -49,6 +49,13 @@ def printc(msg: str):
     print(color(msg + '&r'))
 
 
+def clear_screen():
+    """
+    Clear screen using ANSI escape codes
+    """
+    print('\033[2J\033[H')
+
+
 def redistribute_rgb(r: int, g: int, b: int) -> tuple[int, int, int]:
     """
     Redistribute RGB after lightening