je fais appel à vous car j'ai besoin de savoir comment il est possible modifier la couleur du texte dans une session TTY.
J'ai opté pour cette soluce mais elle ne fonctionne pas.
/usr/bin/colortty
Code : Tout sélectionner
#!/usr/bin/env bash
echo -en "\\033[32m\\033[8]" > /dev/tty1
echo -en "\\033[32m\\033[8]" > /dev/tty2
echo -en "\\033[32m\\033[8]" > /dev/tty3
echo -en "\\033[32m\\033[8]" > /dev/tty4
echo -en "\\033[32m\\033[8]" > /dev/tty5
echo -en "\\033[32m\\033[8]" > /dev/tty6
Code : Tout sélectionner
[Service]
ExecStart=
ExecStart=/usr/bin/colortty
Sinon dans mon bashrc j'ai ceçi:
Code : Tout sélectionner
alias steamx='startx ~/.xinitrc big-picture'
alias xfcex='startx ~/.xinitrc xfce'
if [ "$TERM" = "linux" ]; then
echo -en "\e]P0222222" #black -> this is the background color as well.
echo -en "\e]P1803232" #darkred
echo -en "\e]P25b762f" #darkgreen
echo -en "\e]P3aa9943" #brown
echo -en "\e]P4324c80" #darkblue
echo -en "\e]P5706c9a" #darkmagenta
echo -en "\e]P692b19e" #darkcyan
echo -en "\e]P7ffffff" #lightgray
echo -en "\e]P8222222" #darkgray
echo -en "\e]P9982b2b" #red
echo -en "\e]PA89b83f" #green
echo -en "\e]PBefef60" #yellow
echo -en "\e]PC2b4f98" #blue
echo -en "\e]PD826ab1" #magenta
echo -en "\e]PEa1cdcd" #cyan
echo -en "\e]PFdedede" #white -> this is the foreground color as well.
clear #repaint the whole background with the new color
fi
### Customized part ###############################################################################
findcpu(){
grep 'model name' /proc/cpuinfo | uniq | awk -F':' '{ print $2}'
}
findkernelversion(){
uname -mrs
}
totalmem(){
grep -i 'memtotal' /proc/meminfo | awk -F':' '{ print $2}'
}
mem=$(cat /proc/meminfo | grep MemTotal | head -n 1 | awk '/[0-9]/ {print $2}')
echo " .,-:;//;:=, `tput smso` Aperture Science Terminal Info `tput rmso`
. :H@@@MM@M#H/.,+%;,
,/X+ +M@@M@MM%=,-%HMMM@X/, $(findcpu)
-+@MM; SM@@MH+-,;XMMMM@MMMM@+- `tput bold`RAM memory:`tput sgr0` $[$mem/1024] MB
;@M@@M- XM@X;. -+XXXXXHHH@M@M#@/. `tput bold`Kernel:`tput sgr0` $(findkernelversion)
,%MM@@MH ,@%= .---=-=:=,.
=@#@@@MX ., -%HXSS%%%+;
=-./@M@MS .;@MMMM@MM: `tput smso setaf [1-7]` GLaDOS Monitor `tput rmso`
X@/ -SMM/ .+MM@@@MS ____
,@M@H: :@: . =X#@@@@- `tput bold`System status:`tput sgr0` On / /
,@@@MMX, . /H- ;@M@M= `tput bold`Voice status:`tput sgr0` On ___ / /
.H@@@@M@+, %MM+..%#S. \ \/ /
/MMMM@MMH/. XM@MH; =; `tput bold`Damaged: `tput sgr0` No \ /
/%+%SXHH@S= , .H@@@@MX, `tput bold`Malfunctioning:`tput sgr0` Maybe \___/
.=--------. -%H.,@@@@@MX,
.%MM@@@HHHXXSSS%+- .:MMX =M@@MM%.
=XMMM@MM@MM#H;,-+HMM@M+ /MMMX= `tput smso` Date and Time `tput rmso`
=%@M@M#@S-.=S@MM@@@M; %M%=
':+S+-,/H#MMMMMMM@= =' `tput bold`Date:`tput sgr0` $(date +"%A %d %B %Y")
=++%%%%+/:-. `tput bold`Time:`tput sgr0` $(date +"%T")
"
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
PS1='[\u@\h \[\e[0;36m\]\W\[\e[0m\]]\$ '
export XAUTHORITY='/home/maxou/.Xauthority'
export MANPAGER=less
export EDITOR='vim'
export iplo="$(hostname -i)"
Merci bien et bonne année 2016.