mirror of
https://github.com/GRFreire/dotfiles.git
synced 2026-01-09 20:19:37 +00:00
qtile: improve readability of keybinds window
This commit is contained in:
parent
1fbc495f8a
commit
cf65e56b03
@ -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")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user