From cf65e56b03d804a07ec66d564883912415af88b2 Mon Sep 17 00:00:00 2001 From: Guilherme Rugai Freire Date: Sun, 29 May 2022 16:26:34 -0300 Subject: [PATCH] qtile: improve readability of keybinds window --- .config/qtile/list_keybinds.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/qtile/list_keybinds.py b/.config/qtile/list_keybinds.py index 972553e..39c406c 100644 --- a/.config/qtile/list_keybinds.py +++ b/.config/qtile/list_keybinds.py @@ -8,14 +8,14 @@ def columnate(matrix): def _columnate(matrix): widths = [max(map(len, map(str, col))) for col in zip(*matrix)] for row in matrix: - yield " ".join((str(val).ljust(width) for val, width in zip(row, widths))) + yield " | ".join((str(val).ljust(width) for val, width in zip(row, widths))) return "\n".join(_columnate(matrix)) -matrix = [["Key", "Command"]] +matrix = [["Key", "Command"], ["---", "-------"]] for key in c.keys: keys = ' + '.join((key.modifiers + [key.key])) desc = key.desc matrix.append([keys, desc]) -os.system(f"echo \"{columnate(matrix)}\" | col -bx | less") +os.system(f"echo \"{columnate(matrix)}\" | col -bx | xargs -I \"[]\" printf \"\t%s\n\" \"[]\" | less")