Alterando as cores do lxterminal

4

Como posso alterar as cores padrão do lxterminal no Lubuntu usando .bashrc?

    
por user264934 03.04.2014 / 16:07

2 respostas

6

Para alterar a cor que o prompt usa (editando .bashrc), leia Alterando cores para usuário, host, informações de diretório no prompt de comando do terminal (como no comentário de Jobin).

Por exemplo:

PS1='${debian_chroot:+($debian_chroot)}\[3[01;35m\]\u\[3[01;30m\]@\[3[01;32m\]\h\[3[00m\]:\[3[01;34m\]\w\[3[00m\]\$ \[3[00;36m\]'

Procure o \ [\ 033 [00; 36m \] perto do final. Define a cor dos comandos que você digita. Veja esta resposta para referência ao número de cores.

Se você quer dizer as "cores padrão" como a cor de primeiro plano (geralmente branca ou preta), você pode alterá-la na tela de configurações do LXTerminal. Note que isso é salvo em ~ / .config / lxterminal / lxterminal.conf, não em .bashrc.

Se você quer dizer a aparência de cada cor (por exemplo, você quer fazer azul escuro para algo mais brilhante), então infelizmente você não pode com o LXTerminal porque seu esquema de cores é codificado. Marty Jack do fórum do LXDE escreveu isto :

At this time we do not offer any more customization than foreground/background. You are encouraged to run any terminal emulator that meets your needs.

Se você precisar de terminal leve que suporte personalização de esquema de cores, o xfce4-terminal fará o trabalho. Para instalá-lo, digite o seguinte comando no LXTerminal:

sudo apt-get install xfce4-terminal
    
por NullNoname 06.06.2014 / 12:55
3

Você pode alterar facilmente as cores padrão de LXTerminal . Não sei se essa alteração foi trazida por uma atualização recente ou não, mas agora posso executar o LXTerminal com um esquema de cores personalizado. Eu uso o LXTerminal como um terminal padrão para programar em vim com cores.

Usando os scripts de base16-shell , você pode definir as cores para o LXTerminal. Basta fornecer o script em seu bashrc (ou zshrc ) e as cores apropriadas serão carregadas.

Adicione o seguinte código ao script:

COLOR_SCHEME = "/path/to/colorscheme/script"
[[ -s $COLOR_SCHEME ]] && source $COLOR_SCHEME

Eu mudei o script para usar o esquema de cores Solarized-dark para LXTerminal.

#!/bin/sh
# Colorscheme : Ethan Schoonover(http://ethanshoonover.com)
# Original script for base-16 shell by : Chris Kempson (http://chriskempson.com)
# Adapted by : Shikhar Bhardwaj(http://bluefog.me)

if [ "${TERM%%-*}" = 'linux' ]; then
    # This script doesn't support linux console (use 'vconsole' template instead)
    return 2>/dev/null || exit 0
fi

color00="07/36/42" # Base 00 - Black
color01="dc/32/2f" # Base 08 - Red
color02="85/99/00" # Base 0B - Green
color03="b5/89/00" # Base 0A - Yellow
color04="26/8b/d2" # Base 0D - Blue
color05="d3/36/82" # Base 0E - Magenta
color06="2a/a1/98" # Base 0C - Cyan
color07="ee/e8/d5" # Base 05 - White
color08="00/2b/36" # Base 03 - Bright Black

color09="cb/4b/16" # Base 08 - Bright Red
color10="58/6e/75" # Base 0B - Bright Green
color11="62/62/62" # Base 0A - Bright Yellow
color12="83/94/96" # Base 0D - Bright Blue
color13="f9/55/8b" # Base 0E - Bright Magenta
color14="93/a1/a1" # Base 0C - Bright Cyan

color15="fd/f6/e3" # Base 07 - Bright White
color16="dc/96/56" # Base 09
color17="a1/69/46" # Base 0F
color18="28/28/28" # Base 01
color19="38/38/38" # Base 02
color20="b8/b8/b8" # Base 04
color21="e8/e8/e8" # Base 06
color_foreground=$color07 # Base 05
color_background=$color12 # Base 00
color_cursor="d8/d8/d8" # Base 05

if [ -n "$TMUX" ]; then
  # tell tmux to pass the escape sequences through
  # (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324)
  printf_template="3Ptmux;33]4;%d;rgb:%s
COLOR_SCHEME = "/path/to/colorscheme/script"
[[ -s $COLOR_SCHEME ]] && source $COLOR_SCHEME
73\" printf_template_var="3Ptmux;33]%d;rgb:%s
#!/bin/sh
# Colorscheme : Ethan Schoonover(http://ethanshoonover.com)
# Original script for base-16 shell by : Chris Kempson (http://chriskempson.com)
# Adapted by : Shikhar Bhardwaj(http://bluefog.me)

if [ "${TERM%%-*}" = 'linux' ]; then
    # This script doesn't support linux console (use 'vconsole' template instead)
    return 2>/dev/null || exit 0
fi

color00="07/36/42" # Base 00 - Black
color01="dc/32/2f" # Base 08 - Red
color02="85/99/00" # Base 0B - Green
color03="b5/89/00" # Base 0A - Yellow
color04="26/8b/d2" # Base 0D - Blue
color05="d3/36/82" # Base 0E - Magenta
color06="2a/a1/98" # Base 0C - Cyan
color07="ee/e8/d5" # Base 05 - White
color08="00/2b/36" # Base 03 - Bright Black

color09="cb/4b/16" # Base 08 - Bright Red
color10="58/6e/75" # Base 0B - Bright Green
color11="62/62/62" # Base 0A - Bright Yellow
color12="83/94/96" # Base 0D - Bright Blue
color13="f9/55/8b" # Base 0E - Bright Magenta
color14="93/a1/a1" # Base 0C - Bright Cyan

color15="fd/f6/e3" # Base 07 - Bright White
color16="dc/96/56" # Base 09
color17="a1/69/46" # Base 0F
color18="28/28/28" # Base 01
color19="38/38/38" # Base 02
color20="b8/b8/b8" # Base 04
color21="e8/e8/e8" # Base 06
color_foreground=$color07 # Base 05
color_background=$color12 # Base 00
color_cursor="d8/d8/d8" # Base 05

if [ -n "$TMUX" ]; then
  # tell tmux to pass the escape sequences through
  # (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324)
  printf_template="3Ptmux;33]4;%d;rgb:%s%pre%73\"
  printf_template_var="3Ptmux;33]%d;rgb:%s%pre%73\"
  printf_template_custom="3Ptmux;33]%s%s%pre%73\"
elif [ "${TERM%%-*}" = "screen" ]; then
  # GNU screen (screen, screen-256color, screen-256color-bce)
  printf_template="3P3]4;%d;rgb:%s%pre%73\"
  printf_template_var="3P3]%d;rgb:%s%pre%73\"
  printf_template_custom="3P3]%s%s%pre%73\"
else
  printf_template="3]4;%d;rgb:%s3\"
  printf_template_var="3]%d;rgb:%s3\"
  printf_template_custom="3]%s%s3\"
fi

# 16 color space
printf $printf_template 0  $color00
printf $printf_template 1  $color01
printf $printf_template 2  $color02
printf $printf_template 3  $color03
printf $printf_template 4  $color04
printf $printf_template 5  $color05
printf $printf_template 6  $color06
printf $printf_template 7  $color07
printf $printf_template 8  $color08
printf $printf_template 9  $color09
printf $printf_template 10 $color10
printf $printf_template 11 $color11
printf $printf_template 12 $color12
printf $printf_template 13 $color13
printf $printf_template 14 $color14
printf $printf_template 15 $color15

# 256 color space
printf $printf_template 16 $color16
printf $printf_template 17 $color17
printf $printf_template 18 $color18
printf $printf_template 19 $color19
printf $printf_template 20 $color20
printf $printf_template 21 $color21

# foreground / background / cursor color
if [ -n "$ITERM_SESSION_ID" ]; then
  # iTerm2 proprietary escape codes
  printf $printf_template_custom Pg d8d8d8 # forground
  printf $printf_template_custom Ph 181818 # background
  printf $printf_template_custom Pi d8d8d8 # bold color
  printf $printf_template_custom Pj 383838 # selection color
  printf $printf_template_custom Pk d8d8d8 # selected text color
  printf $printf_template_custom Pl d8d8d8 # cursor
  printf $printf_template_custom Pm 181818 # cursor text
else
  printf $printf_template_var 10 $color_foreground
  printf $printf_template_var 11 $color_background
  printf $printf_template_var 12 $color_cursor
fi

# clean up
unset printf_template
unset printf_template_var
unset color00
unset color01
unset color02
unset color03
unset color04
unset color05
unset color06
unset color07
unset color08
unset color09
unset color10
unset color11
unset color12
unset color13
unset color14
unset color15
unset color16
unset color17
unset color18
unset color19
unset color20
unset color21
unset color_foreground
unset color_background
unset color_cursor
73\" printf_template_custom="3Ptmux;33]%s%s%pre%73\" elif [ "${TERM%%-*}" = "screen" ]; then # GNU screen (screen, screen-256color, screen-256color-bce) printf_template="3P3]4;%d;rgb:%s%pre%73\" printf_template_var="3P3]%d;rgb:%s%pre%73\" printf_template_custom="3P3]%s%s%pre%73\" else printf_template="3]4;%d;rgb:%s3\" printf_template_var="3]%d;rgb:%s3\" printf_template_custom="3]%s%s3\" fi # 16 color space printf $printf_template 0 $color00 printf $printf_template 1 $color01 printf $printf_template 2 $color02 printf $printf_template 3 $color03 printf $printf_template 4 $color04 printf $printf_template 5 $color05 printf $printf_template 6 $color06 printf $printf_template 7 $color07 printf $printf_template 8 $color08 printf $printf_template 9 $color09 printf $printf_template 10 $color10 printf $printf_template 11 $color11 printf $printf_template 12 $color12 printf $printf_template 13 $color13 printf $printf_template 14 $color14 printf $printf_template 15 $color15 # 256 color space printf $printf_template 16 $color16 printf $printf_template 17 $color17 printf $printf_template 18 $color18 printf $printf_template 19 $color19 printf $printf_template 20 $color20 printf $printf_template 21 $color21 # foreground / background / cursor color if [ -n "$ITERM_SESSION_ID" ]; then # iTerm2 proprietary escape codes printf $printf_template_custom Pg d8d8d8 # forground printf $printf_template_custom Ph 181818 # background printf $printf_template_custom Pi d8d8d8 # bold color printf $printf_template_custom Pj 383838 # selection color printf $printf_template_custom Pk d8d8d8 # selected text color printf $printf_template_custom Pl d8d8d8 # cursor printf $printf_template_custom Pm 181818 # cursor text else printf $printf_template_var 10 $color_foreground printf $printf_template_var 11 $color_background printf $printf_template_var 12 $color_cursor fi # clean up unset printf_template unset printf_template_var unset color00 unset color01 unset color02 unset color03 unset color04 unset color05 unset color06 unset color07 unset color08 unset color09 unset color10 unset color11 unset color12 unset color13 unset color14 unset color15 unset color16 unset color17 unset color18 unset color19 unset color20 unset color21 unset color_foreground unset color_background unset color_cursor

No entanto, o espaço de 256 cores não foi alterado corretamente.

Veja o que parece:

    
por bluefog 18.04.2016 / 17:40