Add color variables.

List tmux sessions with zlogin.
This commit is contained in:
Jeremy Gardais 2015-08-28 17:59:10 +02:00
parent ff08ff5b04
commit 9504c2290b
1 changed files with 24 additions and 2 deletions

26
zlogin
View File

@ -6,6 +6,19 @@
# Ce fichier contient les commandes qui s'exécutent quand l'utilisateur
# ouvre une console
#### Colors definition
BLACK='\033[30;40m'
RED='\033[0;31m'
REDB='\033[1;31m'
GREEN='\033[1;32m'
YELLOW='\033[1;33m'
BLUE='\033[34;40m'
MAGENTA='\033[0;35m'
CYAN='\033[36;40m'
WHITE='\033[0;37m'
WHITEB='\033[1;37m'
RESET='\033[0m'
# Afficher des informations sur le systèmes:
#echo "\n#### Info uname ####"
#uname -a
@ -18,7 +31,7 @@
bonjour
# Afficher la liste todo (paquet devtodo)
echo "\n\nListe de tâches:"
printf '%b' "${MAGENTA}++++++++++++++++++++++ ${WHITEB}Liste de tâches${RESET} ${MAGENTA}:++++++++++++++++++++++${RESET}\n"
todo -G --global-database ~/.todo
# Accepte les messages d'autres utilisateurs
@ -41,6 +54,16 @@ if [ -f ~/.ssh/config_00base ]; then
chmod 0600 ~/.ssh/config*
fi
# List tmux sessions if tmux is available
if hash tmux; then
TMUX_SESSION=$(tmux ls|grep -- window)
# If tmux session available and if not already inside a tmux
if [ ${TMUX_SESSION} ] && [ -z "${TMUX}" ]; then
printf '%b' "${MAGENTA}++++++++++++++++++++++++ ${WHITEB}Tmux session${RESET} ${MAGENTA}:++++++++++++++++++++++++${RESET}\n"
tmux ls
fi
fi
# Recupere un caractere unique
getc ()
{
@ -50,7 +73,6 @@ getc ()
stty cooked
}
## Autorun an X session with some restrictions
## Set a ~/.noxorg file to work in tty only
# If non-root session