From 48b4477dbb6010d31a9c53599614e07468d3d663 Mon Sep 17 00:00:00 2001 From: hanjinpeng Date: Sat, 28 Jul 2018 17:31:57 +0800 Subject: [PATCH 1/3] add zh_cn char and cloumn width space --- unimatrix.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/unimatrix.py b/unimatrix.py index 9c42d38..fa8d1b5 100755 --- a/unimatrix.py +++ b/unimatrix.py @@ -201,6 +201,10 @@ parser.add_argument('-w', '--single-wave', help='runs a single "wave" of green rain then exits', action='store_true') +parser.add_argument('-S', '--space', + help='space, integer up to 5. Default=1', + default=1, + type=int) args = parser.parse_args() @@ -231,6 +235,12 @@ 'S': '`-=~!@#$%^&*()_+[]{}|\;\':",./<>?"', 'u': args.custom_characters} +zhcn_chars="" +for ch in range(0x4e00, 0x9fa6): + zhcn_chars += chr(ch) +# zhcn_chars +=" " +char_set["z"]=zhcn_chars + colors_str = { 'green': curses.COLOR_GREEN, 'red': curses.COLOR_RED, @@ -246,6 +256,11 @@ start_bg = colors_str[args.bg_color] speed = args.speed + +width_space = args.space +if width_space >5 : + width_space=5 + start_delay = (100 - speed) * 10 runtime = None @@ -293,7 +308,8 @@ def __init__(self, screen): self.row_count = rows self.size_changed = False self.columns = [] - for col in range(0, cols, 2): + #for col in range(0, cols, 4): + for col in range(0, cols, width_space*2): self.columns.append(Column(col, self.row_count)) self.nodes = [] self.flashers = set() From 262dfb4a56912b3a182776f64c38ae6d93fbb48d Mon Sep 17 00:00:00 2001 From: hanjinpeng Date: Mon, 30 Jul 2018 11:56:32 +0800 Subject: [PATCH 2/3] add commet about -l z and S --- unimatrix.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/unimatrix.py b/unimatrix.py index fa8d1b5..cb7a566 100755 --- a/unimatrix.py +++ b/unimatrix.py @@ -60,6 +60,8 @@ refreshing, 100 uses none. Use negative numbers for even lower speeds. Default=85 + -S SPACE Integer up to 5. space between coloumns + -t TIME Exit the process after TIME seconds -u CUSTOM_CHARACTERS Your own string of characters to display. Enclose in @@ -79,6 +81,7 @@ -h --help -l --character-list=CHARACTER_LIST -s --speed=SPEED + -S --space=space -n --no-bold -o --status-off -t --time @@ -107,6 +110,7 @@ s A subset of symbols actually used in the Matrix films ( -=*_+|:<>" ) S All common keyboard symbols ( `-=~!z#$%^&*()_+[]{}|\;':",./<>?" ) u Custom characters selected using -u switch + z chinese characters For example: '-l naAS' or '--character_list=naAS' will give something similar to the output of the original cmatrix program in its default mode. @@ -308,7 +312,7 @@ def __init__(self, screen): self.row_count = rows self.size_changed = False self.columns = [] - #for col in range(0, cols, 4): + #for col in range(0, cols, 2): for col in range(0, cols, width_space*2): self.columns.append(Column(col, self.row_count)) self.nodes = [] From 30bb916fa470e7b25626f17df18310d5a45feb6c Mon Sep 17 00:00:00 2001 From: hanjinpeng Date: Tue, 4 Jun 2024 16:46:20 +0800 Subject: [PATCH 3/3] Update unimatrix.py Co-authored-by: William Mannard --- unimatrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unimatrix.py b/unimatrix.py index cb7a566..a1f5370 100755 --- a/unimatrix.py +++ b/unimatrix.py @@ -60,7 +60,7 @@ refreshing, 100 uses none. Use negative numbers for even lower speeds. Default=85 - -S SPACE Integer up to 5. space between coloumns + -S SPACE Integer up to 5. Space between columns -t TIME Exit the process after TIME seconds