Discussion forums for Arch Linux, a simple, lightweight linux distribution.
You are not logged in.
I spend a lot of time in the terminal. It's how I browse files, edit configs, manage packages, etc. Plus my job is via ssh. Right now my terminal is pretty plain: Green on Black. I want a colorful, useful terminal experience since I spend so much time there!
So, let me steal ideas from you!
Offline
I'll play
It's mainly aliases
PS1='[\W] '
alias ls='ls --color=auto -F'
alias y='yaourt'
alias yi='yaourt -Sy'
alias yr='yaourt -Rcns'
alias yup='yaourt -Syu --aur'
alias m='mplayer'
alias hella='hellanzb.py'
alias hellanzb='hellanzb.py'
alias wget='wget -c'
alias brand='growisofs -Z /dev/cdrw -v -l -R -J -joliet-long'
alias burn='growisofs -Z /dev/cdrw -v -l -R -J -joliet-long'
alias done='cd ~/Downloads/Done'
alias hd='cd ~/Films/High\ Definition/'
alias anime='cd ~/Anime/'
alias afbeeldingen='cd ~/Afbeeldingen/'
alias muziek='cd ~/Muziek/'
alias tv='cd ~/Tv-series'
alias so='source ~/.bashrc'
alias stats='hellanzb.py status'
alias mptv='mplayer /dev/video0'
alias hdd='df -hT'
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fiOffline
here's mine ![]()
http://pastebin.com/f1692bf9f
besides random aliases for personal use, mine features a way to search through pidgin logs, a 'junk' function which replaces the 'rm' command, so it moves files into a kind of trash folder instead of permanently deleting them, a 'note' function to keep notes once in a while, and, of course, a custom prompt with welcome message ![]()
Last edited by Stythys (2008-06-14 20:22:46)
Offline
Cool stuff.
What does this do?:
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fiHere is mine for right now:
alias ls='ls --color=auto' alias pacman='pacman-color' #PS1='[\u@\h \W]\$ ' PS1='\[\e[0;32m[\]\[\e[0;37m\]\u\[\e[m\] \[\e[0;34m\]\w\[\e[m\] \[\e[0;32m]\]\[\e[0;37m\]\$ \[\e[m\]\[\e[0;32m\] ' complete -cf sudo
I don't even know what that complete -cf sudo line does... It was there already
Last edited by pogeymanz (2008-06-14 20:41:26)
Offline
pogeymanz wrote:
What does this do?:
Code:
if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi
It just checks if you have bash-completion installed and if you do, enables it.
Offline
I have a question: Can you have periods (".") in aliases?
I want to make some tar aliases, like this:
alias tar .gz= 'tar xvzf'
for each kind of tar file
Offline
pogeymanz, have you looked at this page from the wiki? http://wiki.archlinux.org/index.php/Color_Bash_Prompt
Offline
I have. I just wanted to start one of those cool threads like "post your screenshot yay!"
Here is my bashrc as of now:
alias go='startx' alias ls='ls --color=auto' alias pacman='pacman-color' alias targz='tar zxvf' alias tarbz2='tar jxvf' #PS1='[\u@\h \W]\$ ' PS1='\[\e[0;32m[\]\[\e[0;37m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[0;32m]\]\[\e[0;37m\]\$ \[\e[m\]\[\e[0;32m\] ' complete -cf sudo
Offline
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# . ~/.bash_profile
PATH=${PATH}:/home/mindfall/bin
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
if [[ "$TERM" != "dumb" ]]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
alias ll='ls -lhp'
alias lll='ls -lhap --color | less -R'
alias cd..='cd ..'
alias pacman='pacman-color'
complete -cf sudo
fi
tooLong ()
{
pfad="`pwd`"
if [[ ${#pfad} -lt 30 ]]; then
echo -n "${pfad/\/home\/$USER/~}"
else
echo -n "<...> /`basename "$pfad"`"
fi
}
# orginal Arch Prompt
# PS1='[\u@\h \W]\$ '
PS1="\[\033[40;1;33m\]\$(tooLong)\$\[\033[0m\] "
if [[ $UID == 0 ]]; then
PS1="\[\033[1;41m\]\$(tooLong)#\[\033[00m\] "
fiOffline
PATH=~/bin:$PATH shopt -s histappend PROMPT_COMMAND='history -a' complete -cf sudo alias ls='ls --color=auto' alias pacman='sudo pacman' alias abs='sudo abs' alias mp='mousepad' alias nmr='sudo /etc/rc.d/networkmanager restart' PS1='\n\[\033[0;32m\]\u@\h \[\033[1;33m\]\w\n\[\033[0m\]> ' PS2='\\ '
As a bonus, here is my .inputrc
"\e[A": history-search-backward "\e[B": history-search-forward
Offline
source /etc/profile # Aliases: alias ls="ls -b --color=auto --file-type -h" # Shell variables: unset HISTFILE unset MAIL export PATH="/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin" export PS1="[\w] \$ " # Various variables: export LESSHISTFILE="/dev/null" # Various: umask 077
Fascinating, isn't it. I just let /etc/profile{,.bash,.d/*} do most of the work.
Last edited by sniffles (2008-06-15 01:45:39)
Offline
Stythys wrote:
here's mine
http://pastebin.com/f1692bf9f
besides random aliases for personal use, mine features a way to search through pidgin logs, a 'junk' function which replaces the 'rm' command, so it moves files into a kind of trash folder instead of permanently deleting them, a 'note' function to keep notes once in a while, and, of course, a custom prompt with welcome message
Hmm. Why are you running yaourt with sudo? It calls for password when needed anyway and AFAIK it's discouraged to use it with root privileges all the way.
Offline
Building packages from the AUR should be done with as limited privileges as possible.
Offline
Stythys wrote:
meh
pacman needs to be run with sudo...what's the difference with yaourt? =P
The difference is that yaourt deals with PKGBUILDS from AUR. It's advised to build packages without root privileges and use sudo for installing only. (Like when installing from ABS - you would run makepkg as normal user and install the ready package with sudo pacman -S). Just a security thing.
Offline
OK, I don't use AUR so I wasn't aware of this whole thing. Out of curiosity, what "security thing" ? If you don't trust the PKGBUILD or whatever, don't use it? How do you know that once you install the newly built package, you won't get all sorts of evil files on your system?
Offline
sniffles wrote:
OK, I don't use AUR so I wasn't aware of this whole thing. Out of curiosity, what "security thing" ? If you don't trust the PKGBUILD or whatever, don't use it? How do you know that once you install the newly built package, you won't get all sorts of evil files on your system?
That's true. However, once you install the files with pacman you can easily uninstall them with pacman as well. Whereas there can be hardwired paths in the program you're compiling, e.g. installing something directly to /usr/bin - if you run makepkg/yaourt with root privileges all the way you can end up with a totally messed up system. And you won't even know.
Edit: Of course this is not a very likely scenario. If you've tried GoboLinux or Linux From Scratch though, you'll know what I mean.
Last edited by JeremyTheWicked (2008-06-15 05:03:07)
Offline
Nothing new in mine, just aliases and funcions
Offline
JeremyTheWicked wrote:
sniffles wrote:
OK, I don't use AUR so I wasn't aware of this whole thing. Out of curiosity, what "security thing" ? If you don't trust the PKGBUILD or whatever, don't use it? How do you know that once you install the newly built package, you won't get all sorts of evil files on your system?
That's true. However, once you install the files with pacman you can easily uninstall them with pacman as well. Whereas there can be hardwired paths in the program you're compiling, e.g. installing something directly to /usr/bin - if you run makepkg/yaourt with root privileges all the way you can end up with a totally messed up system. And you won't even know.
Edit: Of course this is not a very likely scenario. If you've tried GoboLinux or Linux From Scratch though, you'll know what I mean.
I don't have my Arch system handy atm, but I remember when installing dwm that some messages appeared on the sceen (regarding editing config.h, etc.) Later on I built my own packages and I remember also modifying some text files in order to make sure those messages do not appear when I install the custom package. I'm thinking: instead of making messages appear on the screen, why couldn't those files contain commands for various over evil tasks? Tasks which would be run just once, when the package gets installed. How would you reverse *that* with pacman? Not to mention, the harm could probably have already been done.
Offline
@sniffles: I didn't intend to say that installing unverified programs with pacman is 100% safe. I only meant that running makepkg with root privileges exposes you to more risks - e.g. when a program is coded with hardwired paths.
Offline
alias ls='ls --color=auto'
alias e='$EDITOR'
PS1='[\A \W] '
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/vc/1 ] ; then
export EDITOR=scribes
export PATH=$PATH:/dcs/scripts
export CLASSPATH=.:$CLASSPATH
export PROMPT_COMMAND='echo -ne "\033]0;${HOSTNAME} - ${PWD}\007"'
startxNo aliases other than my editor, I don't like them. I still need the "e" one because automatic completion doesn't help when you have both scribes and Scribus.
Last edited by catwell (2008-06-15 07:03:59)
Offline
I don't have an .bashrc so I'll give you my .zshsh and .Xdefaults instead:
==== .zshrc ====
#-------------------------------------------------------------------------#
# File: .zshrc ZSH resource file #
# Version: 0.1.13 #
# Author: Øyvind "Mr.Elendig" Heggstad <mrelendig AT har-ikkje DOT net> #
#-------------------------------------------------------------------------#
#------------------------------
# History stuff
#------------------------------
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
#------------------------------
# Variables
#------------------------------
export EDITOR="vim"
export MANPAGER="/home/oh/bin/vimpager"
export PATH="$PATH:/home/oh/bin"
#-----------------------------
# Dircolors
#-----------------------------
LS_COLORS='rs=0:di=34:ln=36:pi=40;33:so=01;35:do=35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=32:mi=31';
export LS_COLORS
#------------------------------
# Keybindings
#------------------------------
bindkey -v
typeset -g -A key
#bindkey '\e[3~' delete-char
bindkey '\e[1~' beginning-of-line
bindkey '\e[4~' end-of-line
#bindkey '\e[2~' overwrite-mode
bindkey '^?' backward-delete-char
bindkey '^[[1~' beginning-of-line
bindkey '^[[5~' up-line-or-history
bindkey '^[[3~' delete-char
bindkey '^[[4~' end-of-line
bindkey '^[[6~' down-line-or-history
bindkey '^[[A' up-line-or-search
bindkey '^[[D' backward-char
bindkey '^[[B' down-line-or-search
bindkey '^[[C' forward-char
# for rxvt
bindkey "\e[8~" end-of-line
bindkey "\e[7~" beginning-of-line
# for gnome-terminal
bindkey "\eOH" beginning-of-line
bindkey "\eOF" end-of-line
#------------------------------
# Alias stuff
#------------------------------
alias ls="ls --color -F"
alias ll="ls --color -lh"
alias spm="sudo pacman"
alias spmc="sudo pacman-color"
#------------------------------
# Comp stuff
#------------------------------
zmodload zsh/complist
autoload -Uz compinit
compinit
zstyle :compinstall filename '/home/oh/.zshrc'
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
zstyle ':completion:*:*:killall:*' menu yes select
zstyle ':completion:*:killall:*' force-list always
#------------------------------
# Window title
#------------------------------
case $TERM in
*xterm*|rxvt|rxvt-unicode|rxvt-256color|(dt|k|E)term)
precmd () { print -Pn "\e]0;$TERM - (%L) [%n@%M]%# [%~]\a" }
preexec () { print -Pn "\e]0;$TERM - (%L) [%n@%M]%# [%~] ($1)\a" }
;;
screen)
precmd () {
print -Pn "\e]83;title \"$1\"\a"
print -Pn "\e]0;$TERM - (%L) [%n@%M]%# [%~]\a"
}
preexec () {
print -Pn "\e]83;title \"$1\"\a"
print -Pn "\e]0;$TERM - (%L) [%n@%M]%# [%~] ($1)\a"
}
;;
esac
#------------------------------
# Prompt
#------------------------------
setprompt () {
# load some modules
autoload -U colors zsh/terminfo # Used in the colour alias below
colors
setopt prompt_subst
# make some aliases for the colours: (coud use normal escap.seq's too)
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
eval PR_$color='%{$fg[${(L)color}]%}'
done
PR_NO_COLOR="%{$terminfo[sgr0]%}"
# Check the UID
if [[ $UID -ge 1000 ]]; then # normal user
eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}'
eval PR_USER_OP='${PR_GREEN}%#${PR_NO_COLOR}'
elif [[ $UID -eq 0 ]]; then # root
eval PR_USER='${PR_RED}%n${PR_NO_COLOR}'
eval PR_USER_OP='${PR_RED}%#${PR_NO_COLOR}'
fi
# Check if we are on SSH or not --{FIXME}-- always goes to |no SSH|
if [[ -z "$SSH_CLIENT" || -z "$SSH2_CLIENT" ]]; then
eval PR_HOST='${PR_GREEN}%M${PR_NO_COLOR}' # no SSH
else
eval PR_HOST='${PR_YELLOW}%M${PR_NO_COLOR}' #SSH
fi
# set the prompt
PS1=$'${PR_CYAN}[${PR_USER}${PR_CYAN}@${PR_HOST}${PR_CYAN}][${PR_BLUE}%~${PR_CYAN}]${PR_USER_OP}'
PS2=$'%_>'
}
setprompt
==== .Xdefaults ====
!------------------!
! XFT !
!------------------!
Xft*dpi: 99
Xft*antialias: true
!------------------!
! URvxt Stuff !
!------------------!
!--[term name]--!
!URxvt*termName: rxvt-256color
URxvt*termName: rxvt-unicode
!--[trans and fg/bg]--!
URxvt*fadeColor: black
URxvt*transparent: false
URxvt*shading: 80
URxvt*depth:24
URxvt*background: #1C1C1C
URxvt*foreground: #C4C4C4
URxvt*borderless: 1
!--[font]--!
URxvt*font: -*-terminus-*-*-*-*-12-*-*-*-*-*-*-u
URxvt*boldFont: -*-terminus-bold-*-*-*-12-*-*-*-*-*-*-u
!URxvt*font: xft:DejaVu Sans Mono:pixelsize=8:autohint=true
!URxvt*boldFont: xft:DejaVu Sans Mono:pixelsize=8:bold:autohint=true
!URxvt*italicFont: xft:DejaVu Sans Mono:pixelsize=8:italic:autohint=true
!URxvt*boldItalicFont: xft:DejaVu Sans Mono:pixelsize=8:bold:italic:autohint=true
!--[scrolling]--!
URxvt*scrollBar: false
URxvt*saveLines: 10000
!--[tabs]--!
!URxvt*perl-ext-common: default,tabbed
!--[cursor]--!
URxvt*cursorBlink: true
!--[Colours]--!
URxvt*cursorColor: #FFAF00
! black
URxvt*color0: #000000
URxvt*color8: #808080
! red
URxvt*color1: #A36666
URxvt*color9: #D78787
! green
URxvt*color2: #429942
URxvt*color10: #87D787
! yellow
URxvt*color3: #D7AF87
URxvt*color11: #FFFFAF
! blue
URxvt*color4: #AFAFD7
URxvt*color12: #AFD7FF
! magenta
URxvt*color5: #A872A8
URxvt*color13: #D7AFD7
! cyan
URxvt*color6: #00A8AB
URxvt*color14: #00C8CC
! white
URxvt*color7: #D0D0D0
URxvt*color15: #EFEFEFLast edited by Mr.Elendig (2008-06-15 08:49:26)
Online
catwell wrote:
Code:
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/vc/1 ] ; then export EDITOR=scribes export PATH=$PATH:/dcs/scripts export CLASSPATH=.:$CLASSPATH export PROMPT_COMMAND='echo -ne "\033]0;${HOSTNAME} - ${PWD}\007"' startx
You seem to be missing a "fi" there. Note also that it's a rather strange requirement that if $DISPLAY is zero *and* you're on a particular tty. Surely:
[[ -z "$DISPLAY" ]] && [[ "$(tty)" == /dev/vc/? ]] && {
....
}Is going to be much more likable should you ever sign into VC2? ![]()
-- Thomas Adam
Offline
mindfall wrote:
Code:
# If not running interactively, don't do anything [ -z "$PS1" ] && return
.bashrc doesn't get sourced when running non-interactive, does it?
Offline