From ea3ec50467eea8891e9464f135cafa329275b6fe Mon Sep 17 00:00:00 2001 From: Frank Villaro-Dixon Date: Thu, 22 Aug 2013 21:28:44 +0200 Subject: [PATCH] Some cleanup + ctrl/alt swap --- bashrc | 97 +++++++++++++++++++++++++++++++++--------------------- install.sh | 1 + xinitrc | 5 +++ 3 files changed, 66 insertions(+), 37 deletions(-) diff --git a/bashrc b/bashrc index c752dbf..27f8a5f 100644 --- a/bashrc +++ b/bashrc @@ -1,14 +1,7 @@ -#####POUR PAS S'ECRIRE DESSUS -shopt -s checkwinsize +shopt -s checkwinsize #Pour pas s'écrire dessus shopt -s histappend PROMPT_COMMAND='history -a' -#set -o vi -export EDITOR="vim" - -GPG_TTY=`tty` -export GPG_TTY -export GPGKEY=6F36914A #####ON DEFINIT LES COULEURS red='\033[31m' @@ -20,22 +13,18 @@ CYAN='\033[36m' magenta='\033[35m' DFT='\033[0m' white='\033[37m' -#####ON DEFINIT LE TITRE DE LA FENETRE PAR LE REP EN COURS + + +#####ON DÉFINIT LE TITRE DE LA FENETRE PAR LE REP EN COURS case "$TERM" in xterm*|rxvt*) - PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"' - ;; + PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"' + ;; *) - ;; + ;; esac -#####ON MET LA COULEUR POUR ls -if [ "$TERM" != "dumb" ]; then - eval "`dircolors -b`" - alias ls='ls --color=auto' -fi - #####LA COULEUR DU SHELL #PS1="$RED\u$DFT$white@$magenta\h $DFT>>$CYAN\w $DFT" #PS1="\u@\h >>\w " @@ -49,12 +38,17 @@ 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$ ' +source ~/.bash_ps1 #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 + +############### +#### ALIAS #### +############### +# {{{ alias ..='cd ..' alias vf='cd' alias xs='cd' @@ -69,6 +63,10 @@ alias df='dfc' alias free='freec' alias shred='shred -n 35 -z -u -v -f' +if [ "$TERM" != "dumb" ]; then + eval "`dircolors -b`" + alias ls='ls --color=auto' +fi alias sl='ls' alias la='ls -lah' @@ -121,28 +119,27 @@ alias ip6='ip -6' alias disk-usage-analyser='baobab' - -export PYTHONPATH=/usr/local/lib/python2.7/dist-packages -export CC=clang - - -export DEVKITPRO=/opt/devkitpro -export DEVKITARM=$DEVKITPRO/devkitARM -export PATH=$PATH:$DEVKITARM/bin -export MANPATH=$MANPATH:$DEVKITARM/man +# }}} +############### +## FONCTIONS ## +############### +# {{{ function cd() { +# {{{ if [ $# -eq 0 ]; then builtin cd ~ && ls else builtin cd "$*" && ls fi } +#}}} alias ssh='hh' -function hh { +function hh +{ # {{{ ssh-add -l | grep id_rsa.auth > /dev/null if [ $? -eq 1 ]; then echo -e "$RED Please enter ssh passphrase ;) $DFT" @@ -150,18 +147,23 @@ function hh { fi; "/usr/bin/ssh" "$*" } +# }}} - -function logs { +function logs +{ # {{{ tail -f $1 | ccze -A } +# }}} -function mkcd() { +function mkcd() +{ # {{{ mkdir -p "$@" cd "$@" } +# }}} -extract() { +extract() +{ # {{{ local e=0 i c for i; do if [ -f $i && -r $i ]; then @@ -189,9 +191,8 @@ extract() { done return $e } - -#Launch startx when login -[[ -z $DISPLAY && $XDG_VTNR -le 4 && -z $SSH_CLIENT ]] && exec startx +# }}} +# }}} SSHAGENT=/usr/bin/ssh-agent SSHAGENTARGS="-s" @@ -199,3 +200,25 @@ if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then eval `$SSHAGENT $SSHAGENTARGS` trap "kill $SSH_AGENT_PID" 0 fi + +############### +### EXPORTS ### +############### +# {{{ +export EDITOR="vim" + +GPG_TTY=`tty` +export GPG_TTY +export GPGKEY=6F36914A + +export PYTHONPATH=/usr/local/lib/python2.7/dist-packages +export CC=clang + +export DEVKITPRO=/opt/devkitpro +export DEVKITARM=$DEVKITPRO/devkitARM +export PATH=$PATH:$DEVKITARM/bin +export MANPATH=$MANPATH:$DEVKITARM/man +# }}} + +#Launch startx when login +[[ -z $DISPLAY && $XDG_VTNR -le 4 && -z $SSH_CLIENT ]] && exec startx diff --git a/install.sh b/install.sh index 0ba096d..5db3fb2 100755 --- a/install.sh +++ b/install.sh @@ -4,6 +4,7 @@ function deploy_for_desktop() { # {{{ cd ~ ln -s $WAI/xinitrc ./.xinitrc + ln -s $WAI/Xmodmap ./.Xmodmap ln -s $WAI/octaverc ./.octaverc ln -s $WAI/gitconfig ./.gitconfig diff --git a/xinitrc b/xinitrc index e56847c..9818d62 100644 --- a/xinitrc +++ b/xinitrc @@ -25,6 +25,11 @@ wmname LG3D #Keyboard setup +compose key for "ŭ" (Win-b u) for esperanto setxkbmap -model pc104 -layout ch -variant fr -option compose:lwin +#My pinkie hurts :'( +if [ -s ~/.Xmodmap ]; then + xmodmap ~/.Xmodmap +fi + while true; do $OCTOPUS refresh sleep 50