xterm-console/_service:obs_scm:xterm-console
Marius Kittler bf4e0180e7 Accepting request 898655 from devel:openQA
* Handle glyphs without unicode mapping gracefully
  * Fix generating psf2 fonts with multiple codepoints per glyph
  * psf2bdf.pl: Support mapping multiple codepoints to a glyph
  * Use eurlatgr as font
  * Further cleanup of spec-file
  * Cleanup spec-file (delete unused symbol; simplify)
  * Delete old pre-SLE11 cruft
  * Mark as noarch as there are only scripts
  * Cleanup spec-file
  * Add files from https://build.opensuse.org/package/show/devel:openQA/xterm-console

OBS-URL: https://build.opensuse.org/request/show/898655
OBS-URL: https://build.opensuse.org/package/show/devel:openQA:tested/xterm-console?expand=0&rev=12
2021-06-09 08:41:41 +00:00

75 lines
1.9 KiB
Python

#!/usr/bin/python3
# Copyright (C) 2015 Susanne Oberhauser-Hirschoff <froh@suse.de>
# The MIT License applies (http://opensource.org/licenses/MIT)
"""start an xterm that looks like a linux console
# do this once, to let the xserver know about the fonts
xset fp+ $(pwd)
# for each font you want to try...
gunzip -c /usr/share/kbd/consolefonts/lat9w-16.psfu.gz | perl psf2bdf.pl > lat9w-16.bdf
sed -i -e s,-psf-,lat9w_16, lat9w-16.bdf
# update the fonts.dir file
mkfontdir
# notify X about the new font
xset fp rehash
# have a look :)
# start an xterm with the right colors and all, script is attached [3]
python3 xterm_linux_vt.py
"""
# from pprint import pprint as pp
default_kernel_vt_colors = {}
RGB = ("red", "grn", "blu")
for cname in RGB:
with open("/sys/module/vt/parameters/default_{}".format(cname)) as f:
colors = f.read().rstrip().split(',')
default_kernel_vt_colors[cname] = map(int, colors)
xterm_colors= list()
for r, g, b in zip(*(default_kernel_vt_colors[c] for c in RGB)):
xterm_colors.append("rgb:{r:02x}/{g:02x}/{b:02x}".format(**locals()))
def xtc(label, color):
return ("-xrm", "xterm*{label}: {color}".format(**locals()))
def xrm_color_options():
yield(xtc("foreground", xterm_colors[7]))
yield(xtc("background", xterm_colors[0]))
for i, c in enumerate(xterm_colors):
yield(xtc("color{}".format(i), c))
from itertools import chain
import os
xx = [
"xterm",
# console font
"-fn", "eurlatgr",
"-fullscreen",
# no scrollbar
"+sb",
# no border
"-b", "0",
# blinking underline cursor
"-bc", "-uc", "-bcf", "200", "-bcn", "200",
# intense colors for bold
"+bdc",
# intense for bold...
"-xrm", "xterm*boldMode: false",
]
import sys # for argv
sys.argv.pop(0) # strip command name
xx.extend(chain(*xrm_color_options()))
xx.extend(sys.argv)
os.execvp("xterm", xx)