bash (.bashrc)

bashrc com variável PS1 mais completa e com visual mais dinâmico

Categoria: Console

Software: bash

[ Hits: 4.781 ]

Por: Renan Samuel da Silva


Meu bashrc. Possui uma variável PS1 mais "completa" e com um visual mais dinâmico.


#!/bin/sh
#
# ~/.bashrc
#

#Welcome msg
echo '   _ '
echo '  °v° ** Bem-vindo a '`hostname`' **'
echo ' /(_)\ '
echo '  ^ ^ ' `date`
echo ' '

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

# Source scripts in /etc/X11/xinit/xinitrc.d/
#if [ -d /etc/X11/xinit/xinitrc.d ]; then
#    for f in /etc/X11/xinit/xinitrc.d/*; do
#        [ -x "$f" ] && . "$f"
#    done
#    unset f
#fi

export EDITOR="nano"
export VISUAL="nano"

alias ls='ls --color=auto'
alias xterm='xterm -fg white -bg black -geom 80x24 -T xterm -e /usr/bin/pre-exec /usr/bin/fader 0.7'
alias pcmanfm='pcmanfm --no-desktop &'
alias xinit='xinit &'
alias halt='sudo halt'
alias reboot='sudo reboot'

extract() {
    local c e i

    (($#)) || return

    for i; do
        c=''
        e=1

        if [[ ! -r $i ]]; then
            echo "$0: file is unreadable: \`$i'" >&2
            continue
        fi

        case $i in
        #*.t@(gz|lz|xz|b@(2|z?(2))|a@(z|r?(.@(Z|bz?(2)|gz|lzma|xz)))))
        #       c='bsdtar xvf';;
        *.7z)  c='7z x';;
        *.Z)   c='uncompress';;
        *.bz2) c='bunzip2';;
        *.exe) c='cabextract';;
        *.gz)  c='gunzip';;
        *.rar) c='unrar x';;
        *.xz)  c='unxz';;
        *.zip) c='unzip';;
        *)     echo "$0: unrecognized file extension: \`$i'" >&2
               continue;;
        esac

        command $c "$i"
        e=$?З
    done

    return $e
}

# Mapa de Teclado
setxkbmap -model abnt2 -layout br -variant abnt2
setxkbmap -option terminate:ctrl_alt_bksp

# Regular Colors
Black='\e[0;30m'        # Black
Red='\e[0;31m'          # Red
Green='\e[0;32m'        # Green
Yellow='\e[0;33m'       # Yellow
Blue='\e[0;34m'         # Blue
Purple='\e[0;35m'       # Purple
Cyan='\e[0;36m'         # Cyan
White='\e[0;37m'        # White

#LE COOL
PS1="\[\e[01;31m\]┌─[\[\e[01;36m\u\e[01;31m\]]──[\[\e[01;32m\]${HOSTNAME%%.*}\[\e[01;31m\]]──[\[{FONTE}33[1;33m\]\w\[{FONTE}33[1;31m\]]-\[\e[01;33m\]$\[\e[01;31m\]\n\[\e[01;31m\]└──\[\e[01;92m\]>>\[\e[0m\]" 
  


Comentários
[1] Comentário enviado por edsoncsouza em 21/06/2012 - 10:23h

Muito enfeitada =/


Contribuir com comentário

  



Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts