Outils pour utilisateurs

Outils du site


prompt.sh

Copier ce code dans /etc/profile.d/

Modifier rootcolor et usercolor en fonction de vos goûts.

#! /bin/bash
Black='\e[0;30m'        # Black
Blue='\e[0;34m'         # Blue
Cyan='\e[0;36m'         # Cyan
Green='\e[0;32m'        # Green
Purple='\e[0;35m'       # Purple
Red='\e[0;31m'          # Red
White='\e[0;37m'        # White
Yellow='\e[0;33m'       # Yellow
# Background
On_Black='\e[40m'       # Black
On_Red='\e[41m'         # Red
On_Green='\e[42m'       # Green
On_Yellow='\e[43m'      # Yellow
On_Blue='\e[44m'        # Blue
On_Purple='\e[45m'      # Purple
On_Cyan='\e[46m'        # Cyan
On_White='\e[47m'       # White


reset='\e[0m'       # Text Reset

usercolor="${Green}${On_Black}"

rootcolor="${White}${On_Green}"

if [ $UID == 0 ] ; then
      usercolor="$rootcolor"
      else
            usercolor="$usercolor"
fi
PS1="\[$usercolor\]\u\[$reset\]@\[\e[47;34m\]\h \[$reset\]\w\$ "

# vim: set filetype=dokuwiki:

prompt.sh.txt · Dernière modification: 2015/10/06 20:06 (modification externe)