From a28487fe6fbac72c7b1a752acab42dcc6ab46476 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Wed, 28 May 2025 14:24:58 -0400 Subject: Post server fs corruption --- scripts/desktop/term-font-size | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 scripts/desktop/term-font-size (limited to 'scripts/desktop/term-font-size') diff --git a/scripts/desktop/term-font-size b/scripts/desktop/term-font-size new file mode 100755 index 0000000..0637b12 --- /dev/null +++ b/scripts/desktop/term-font-size @@ -0,0 +1,20 @@ +#! /usr/bin/env python3 + +import array +import fcntl +import termios +import os + +def get_term_res(): + buf = array.array('H', [0, 0, 0, 0]) + fcntl.ioctl(1, termios.TIOCGWINSZ, buf) + return buf[2], buf[3] + +def get_term_dimensions(): + return os.get_terminal_size() + +x_px, y_px = get_term_res() +size = get_term_dimensions() +x_cell, y_cell = size.columns, size.lines + +print('width : {}, height: {}'.format(x_px / float(x_cell), y_px / float(y_cell))) -- cgit v1.2.3-101-g0448