mirror of
https://github.com/gryf/urxvt-wrapper.git
synced 2025-12-17 11:30:21 +01:00
Added argument parsing and translate them to urxvt execution
This commit is contained in:
42
urxvt.py
42
urxvt.py
@@ -206,11 +206,45 @@ def main():
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
command = ['urxvt']
|
||||||
|
command.extend(['-icon', os.path.join(os.path.expanduser(ICON_PATH),
|
||||||
|
args.icon)])
|
||||||
|
|
||||||
|
global LOG
|
||||||
|
log = Logger(__name__)
|
||||||
|
log.set_verbose(args.verbose, args.quiet)
|
||||||
|
LOG = log()
|
||||||
|
|
||||||
|
if not args.no_perl:
|
||||||
|
command.append('-pe')
|
||||||
|
if args.tabbedalt:
|
||||||
|
command.append('tabbedalt,' + PERLEXT)
|
||||||
|
else:
|
||||||
|
command.append(PERLEXT)
|
||||||
|
|
||||||
|
size = args.size
|
||||||
font_faces = _ADDITIONAL_FONTS[:]
|
font_faces = _ADDITIONAL_FONTS[:]
|
||||||
font_faces.insert(0, DEFAULT_TTF)
|
if ',' in args.default_font:
|
||||||
regular = _get_font_list(font_faces)
|
f_f = [f.strip() for f in args.default_font.split(',')]
|
||||||
print(regular)
|
f_f.extend(font_faces)
|
||||||
subprocess.run(['urxvt', '-fn', regular])
|
font_faces = f_f
|
||||||
|
else:
|
||||||
|
font_faces.insert(0, args.default_font)
|
||||||
|
|
||||||
|
if args.bitmap:
|
||||||
|
font_faces.insert(0, DEFAULT_BITMAP)
|
||||||
|
|
||||||
|
# __import__('ipdb').set_trace()
|
||||||
|
fn = ['-fn', _get_font_list(font_faces, size)]
|
||||||
|
print(fn)
|
||||||
|
fb = ['-fb', _get_font_list(font_faces, size, True)]
|
||||||
|
print(fn)
|
||||||
|
print(fb)
|
||||||
|
command.extend(fn)
|
||||||
|
command.extend(fb)
|
||||||
|
|
||||||
|
LOG.info('%s', command)
|
||||||
|
subprocess.run(command)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user