Advertisement
ItachiSan

my .bashrc

May 20th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.77 KB | None | 0 0
  1. #
  2. # ~/.bashrc
  3. # Modded for beauty
  4. #
  5.  
  6. # If not running interactively, don't do anything
  7. [[ $- != *i* ]] && return
  8. PS1='[\u@\h \W]\$ '
  9.  
  10. # Colors yeeeeeeeeeeeeeeeeee
  11. alias ls='ls --color=auto'
  12. alias grep='grep --color=auto'
  13. alias fgrep='fgrep --color=auto'
  14. alias egrep='egrep --color=auto'
  15.  
  16. # Let's use auto-completion for sudo
  17. complete -cf sudo
  18.  
  19. # Some other aliases for me
  20. alias update-grub='sudo update-grub'='sudo grub-mkconfig -o /boot/grub/grub.cfg'
  21. alias pacman='sudo pacman'
  22. export EDITOR='gedit'
  23.  
  24. # Now, internal function section!
  25.  
  26. # Make an Android build and show you start and end time
  27. bacon-counter (){
  28. START=$(date)
  29. lunch
  30. make bacon
  31. echo
  32. echo 'Task started at:' $START
  33. echo 'Task ended at:' $(date)
  34. echo
  35. }
  36.  
  37. #Same, but with recovery image
  38. recovery-counter (){
  39. START=$(date)
  40. lunch
  41. make recoveryimage
  42. echo
  43. echo 'Task started at:' $START
  44. echo 'Task ended at:' $(date)
  45. echo
  46. }
  47.  
  48. # Export variables in order to build Android like a boss
  49. android-build-env () {
  50.  
  51.     # Variable for correct folder    
  52.     WORK_PATH=$(pwd)
  53.    
  54.     echo
  55.     echo "Preparing workspace in" $WORK_PATH
  56.     echo
  57.  
  58.     # Exporting right paths
  59.  
  60.     echo "Setting up \$PATHs"
  61.     echo 'Android Tools...'
  62.     # Android tools
  63.     export PATH="/opt/android-sdk/tools:/opt/android-sdk/platform-tools:/opt/android-build:$PATH"
  64.     echo 'Sun Java 6...'
  65.     # Java6
  66.     export J2SDKDIR=/opt/java6
  67.     export PATH=/opt/java6/bin:/opt/java6/db/bin:$PATH
  68.     export JAVA_HOME=/opt/java6
  69.     export DERBY_HOME=/opt/java6/db
  70.  
  71.     echo
  72.     echo "Changing directory and setting compiler variables..."
  73.     cd $WORK_PATH
  74.    
  75.     # Compiler declarations
  76.     export ARCH=arm
  77.     export SUBARCH=arm
  78.     export CROSS_COMPILE=arm-eabi-
  79.     ## For using prebuilt toolchains
  80.     #export PATH="$WORK_PATH/prebuilts/arm-eabi-4.6/arm-eabi/bin/:$PATH"
  81.     #export PATH="$WORK_PATH/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/:$PATH"
  82.     ## If using gcc-multilib 4.4 (AUR for archlinux)
  83.     #export CC=gcc-4.4
  84.     #export CXX=g++-4.4
  85.    
  86.     echo
  87.     echo "Setting up ccache"
  88.     export USE_CCACHE=1
  89.     export CCACHE_DIR=./ccache
  90.  
  91.     # Check where we have ccache (differs from ICS<= and JB)
  92.     CCHACHE_BIN_DIR=./prebuilt/linux-x86/ccache
  93.     if [ -d "./prebuilts/misc/linux-x86/ccache" ]; then
  94.     CCHACHE_BIN_DIR=./prebuilts/misc/linux-x86/ccache
  95.     fi
  96.     # Manage ccache at your wish ;) I set 10G as I can
  97.     $CCHACHE_BIN_DIR/ccache -M 10G
  98.  
  99.     echo
  100.     echo "Reading devices configs..."
  101.     echo
  102.     . build/envsetup.sh
  103.     # reading for building androids
  104.     echo
  105.     echo "### Android Build Environment ready!###"
  106.     echo
  107. }
  108.  
  109. # For updating Arch
  110. update() {
  111. echo 'Updating system packages'
  112. yaourt -Syyu
  113. echo
  114. echo 'Done!'
  115. echo
  116. echo 'Updating AUR'
  117. yaourt -Sua
  118. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement