From d99cbf8a4efbc43bff8c4190d698fa5f1306d75f Mon Sep 17 00:00:00 2001 From: Frank Villaro-Dixon Date: Mon, 29 Jul 2013 18:34:39 +0200 Subject: [PATCH] Bash (colors & ssh agent), git_auto and xinit(sshag) --- bashrc | 11 ++++++++++- git_auto_pull.sh | 2 +- xinitrc | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/bashrc b/bashrc index 59bb562..cc3a90e 100644 --- a/bashrc +++ b/bashrc @@ -37,8 +37,16 @@ fi #PS1="\[$RED\u$DFT$white@$magenta\h $DFT>>$CYAN\w $DFT\]" #PS1="\[$RED\]\u\[$DFT$white\]@\[$magenta\]\h \[$DFT\]>>\[$CYAN\]\w \[$DFT\]" #PROMPT_COMMAND='history -a;echo -en "\033[m\033[38;5;2m"$(( `sed -nu "s/MemFree:[\t ]\+\([0-9]\+\) kB/\1/p" /proc/meminfo`/1024))"\033[38;5;22m/"$((`sed -nu "s/MemTotal:[\t ]\+\([0-9]\+\) kB/\1/Ip" /proc/meminfo`/1024 ))MB"\t\033[m\033[38;5;55m$(< /proc/loadavg)\033[m"' - PS1='\[\e[0;36m\] \T \[\e[1;30m\][\[\e[1;34m\]\u@\H\[\e[1;30m\]\[\e[0;32m\]\[\e[1;30m\]] \[\e[1;37m\]\w\[\e[0;37m\] \n$ ' +if [ "$HOSTNAME" == "chuck" ]; then + MY_HOST_COL='[31m' #ugly ! +else + MY_HOST_COL='[34m' +fi + +PS1='\[\e[0;36m\]\T \[\e[1;30m\][\[\e$MY_HOST_COL\]\u@\H\[\e[1;30m\]\[\e[0;32m\]\[\e[1;30m\]] \[\e[1;37m\]\w\[\e[0;37m\] \n$ ' + +#PS1='\[\e[0;36m\] \T \[\e[1;30m\][\[\e$MY_HOST_COL\]\u@\H\[\e[1;30m\]\[\e[0;32m\]\[\e[1;30m\]] \[\e[1;37m\]\w\[\e[0;37m\] \n$ ' #####LES ALIAS UTILES @@ -99,6 +107,7 @@ alias mfilms='cd /dev/shm && mkdir films && sshfs frank@vi-di.fr:/media/ films/' alias upgrub='sudo grub-mkconfig -o /boot/grub/grub.cfg' +alias ssh='ssh-add -l >/dev/null || ssh-add ~/.ssh/id_rsa.auth && unalias ssh; ssh' #MONITOR_PATH=~/Programmation/Utils/monitor.sh #alias dual='$MONITOR_PATH dual' diff --git a/git_auto_pull.sh b/git_auto_pull.sh index 02cacd7..0770633 100755 --- a/git_auto_pull.sh +++ b/git_auto_pull.sh @@ -10,7 +10,7 @@ magenta='\033[35m' DFT='\033[0m' white='\033[37m' -for gitrepo in `find ./ -maxdepth 3 -type d -name ".git" | sed 's/\/.git\+$//'`; +for gitrepo in `find ./ -maxdepth 4 -type d -name ".git" | sed 's/\/.git\+$//'`; do cd $gitrepo echo $gitrepo diff --git a/xinitrc b/xinitrc index 1fafdcb..1e8a6e7 100644 --- a/xinitrc +++ b/xinitrc @@ -32,7 +32,8 @@ while true; do sleep 240 done & xautolock -time 60 -locker "systemctl suspend" & -exec /home/frank/Programmation/dotfiles/dwm/dwm + +ssh-agent -t 10 /home/frank/Programmation/dotfiles/dwm/dwm # exec gnome-session