Инструменты пользователя

Инструменты сайта


system:putty-customization

Настраиваем putty

putty color scheme

Следующий файл необходимо импортировать в реестр Windows - putty-alex_hha.reg . После импорта в списке сессий putty будет доступна новая сессия с именем ALex_hha

bash command prompt

Необходимо добавить следующие строки в ~/.bashrc

export PROMPT_DIRTRIM=5
export PS1='\n\[\033[1;30m\][\t \D{%Z}, \D{%d.%m.%Y}] on \[\033[0;31m\]\u\[\033[1;33m\]@\[\033[0;36m\]\H:\n\[\033[0;32m\][\w]\[\033[1;33m\]\$ \[\033[00m\]'

Вот так стал выглядеть терминал после небольших изменений

Вывод схемы цветов ANSI

Для сравнения привожу стандартные настройки

Вывод схемы цветов ANSI (настройки по умолчанию)

midnight commander

#!/bin/bash
#
# ansi-colors.sh
# This file echoes a bunch of color codes to the 
# terminal to demonstrate what's available.  Each 
# line is the color code of one forground color,
# out of 17 (default + 16 escapes), followed by a 
# test use of that color on all nine background 
# colors (default + 8 escapes).
#

T='gYw'   # The test text

echo -e "\n                 40m     41m     42m     43m\
     44m     45m     46m     47m";

for FGs in '    m' '   1m' '  30m' '1;30m' '  31m' '1;31m' '  32m' \
           '1;32m' '  33m' '1;33m' '  34m' '1;34m' '  35m' '1;35m' \
           '  36m' '1;36m' '  37m' '1;37m';
  do FG=${FGs// /}
  echo -en " $FGs \033[$FG  $T  "
  for BG in 40m 41m 42m 43m 44m 45m 46m 47m;
    do echo -en "$EINS \033[$FG\033[$BG  $T  \033[0m";
  done
  echo;
done
echo


#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
    tcolorsinfo
    ~~~~~~~~~~~

    Performs simple test of terminal ANSI colors.

    :Compatibility: Python 2.7 / 3.2
    :Copyright: (c) 2014 Miroslav Koskar 
    :License: BSD 2-Clause, see LICENSE for details
"""

from __future__ import print_function

from sys import stdout
import argparse
import re
import textwrap

parser = argparse.ArgumentParser(
    formatter_class=argparse.RawDescriptionHelpFormatter,
    description=textwrap.dedent("""
        Performs simple test of terminal ANSI colors.
        Uses following SGR escape sequences:

        * colors 0-7   : CSI 3x/4x m
        * colors 8-15  : CSI 9x/10x m
        * colors 16+   : CSI 38;5;x/48;5;x m

        By default it prints 0-15 foreground on 0-15 background colors split
        in 2 tables. Default foreground and background colors are always included.
        Output can be inverted by using '-t' option.

        If at least one positional argument is specified it will determine
        the output. One can specify foreground and background color ranges as
        2 positional arguments. Format of each range argument is:

        [,end_color_index,[step]]

        E.g.,

        * 0,64,8        - yields: 0, 8, 16, 24, 32, 40, 48, 56
        * 5,10          - yields: 5, 6, 7, 8, 9
        * 35            - yields: 35, 36, 37, 38, 39, 40, 41, 42

        Examples:

        $ tcolorsinfo 0,16       - 0-15 foreground colors on 0-7 backgrounds
        $ tcolorsinfo 0,16 0,16  - 16x16 color cube
        """
    )
)

parser.add_argument('-b', '--bold', action='store_true', help='CSI 1 m')
parser.add_argument('-f', '--faint', action='store_true', help='CSI 2 m')
parser.add_argument('-s', '--standout', action='store_true', help='CSI 3 m')
parser.add_argument('-u', '--underlined', action='store_true', help='CSI 4 m')
parser.add_argument('-l', '--blink', action='store_true', help='CSI 5 m')
parser.add_argument('-r', '--reverse', action='store_true', help='CSI 7 m')
parser.add_argument('-t', '--transpose', action='store_true')
parser.add_argument('fg_range', nargs='?')
parser.add_argument('bg_range', nargs='?')
args = parser.parse_args()

# color range pattern for input parsing
CRANGE_PATTERN = re.compile(r'(\d+)(,(\d+)(,(\d+))?)?')


def parse_range(string):
    if string is None:
        return (0, None, None)
    match = CRANGE_PATTERN.match(string)
    if not match:
        raise RuntimeError('invalid color range format')
    return match.group(1, 3, 5)


def fg_attrs(c):
    if c is None or c < 0:
        return (39,)
    if c < 16:
        return (30 + 60 * (c // 8) + c % 8,)
    return (38, 5, c)


def bg_attrs(c):
    if c is None or c < 0:
        return (49,)
    if c < 16:
        return (40 + 60 * (c // 8) + c % 8,)
    return (48, 5, c)


def echo(text, fg=None, bg=None, attrs=None):
    all_attrs = []
    if attrs is not None:
        all_attrs.extend(attrs)
    all_attrs.extend(fg_attrs(fg))
    all_attrs.extend(bg_attrs(bg))
    stdout.write('\033[{}m{}\033[0m'.format(';'.join(map(str, all_attrs)), text))


def cstr(c):
    return 'none' if c is None else '{:d}'.format(c)


def cname(c):
    if c is None:
        return 'none'
    if c >= 16:
        return cstr(c)
    return {
        0: 'black',
        1: 'red',
        2: 'green',
        3: 'yellow',
        4: 'blue',
        5: 'magenta',
        6: 'cyan',
        7: 'white'
    } [c % 8] + '+' * (c // 8)


def print_row(header, cells):
    print('{:<5} '.format(header), end='')
    for c in cells:
        echo('{:^10}'.format(c[0]), *c[1:])
    print()


def print_header(header, colors):
    print()
    print_row(header, [(cstr(c),) for c in colors])
    print_row('-' * 5, [('-' * 8,) for c in colors])


def color_range(b, e, s=None):
    s = int(s or 1) or 1
    if e is None:
        e = int(b) + 8
    colors = [None]
    colors.extend(range(int(b), int(e), s))
    return colors


def render(fg_range, bg_range, transpose=False):
    fg_colors = color_range(*fg_range)
    bg_colors = color_range(*bg_range)

    vcolors = bg_colors if transpose else fg_colors
    hcolors = fg_colors if transpose else bg_colors

    print_header('bg/fg' if transpose else 'fg/bg', hcolors)
    for vc in vcolors:
        if transpose:
            print_row(cstr(vc), [(cname(hc), hc, vc, attrs) for hc in hcolors])
        else:
            print_row(cstr(vc), [(cname(vc), vc, hc, attrs) for hc in hcolors])
    print()


attrs = []
if args.bold:
    attrs.append(1)
if args.faint:
    attrs.append(2)
if args.standout:
    attrs.append(3)
if args.underlined:
    attrs.append(4)
if args.blink:
    attrs.append(5)
if args.reverse:
    attrs.append(7)

if args.fg_range:
    render(parse_range(args.fg_range),
           parse_range(args.bg_range),
           args.transpose)
else:
    if args.transpose:
        render((0, 8), (0, 16), True)
        render((0, 8), (0, 16), True)
    else:
        render((0, 16), (0, 8))
        render((0, 16), (8, 16))
# .minttyrc
CursorType=block
Transparency=low
OpaqueWhenFocused=no

Font=Consolas
FontHeight=18
FontSmoothing=full
BoldAsFont=-1

Locale=en_US
Charset=UTF-8

ForegroundColour=155,125,75
BackgroundColour=20,20,40
CursorColour=95,225,95

Black=0,0,0
BoldBlack=85,85,85
Red=175,55,15
BoldRed=225,75,35
Green=25,125,25
BoldGreen=75,175,75
Yellow=165,140,20
BoldYellow=225,185,25
Blue=25,65,135
BoldBlue=85,85,185
Magenta=155,85,155
BoldMagenta=185,75,185
Cyan=50,125,150
BoldCyan=85,185,225
White=185,185,185
BoldWhite=225,225,225

system/putty-customization.txt · Последние изменения: 2016/09/08 16:22 — root