Advertisement
noes1s

Kali Linux post-install

Apr 5th, 2013
2,797
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 10.62 KB | None | 0 0
  1. #!/bin/bash
  2. #  ,___    
  3. #  ¡  _`    
  4. #  ª_/()    Kali Linux Noes1s Theme (Gnome GTK2.x)
  5. #  |\` `,   by Noesis Prada
  6. # _·    l  
  7. #
  8. # MANUAL:
  9.  
  10. # This script requires INTERNET CONECTION to install and download themes, wallpapers, apps...
  11. #
  12. # 1) Give a name to the app that is going to be configured/installed
  13. #     do not use spaces for the name
  14. #     app=<name here, do not use caps>
  15. #
  16. # 2) The function "isInstalled NAME" will check if NAME is installed and return 0 if yes, 1+ if not
  17. #
  18. # 3) Commands for config/install, you must end this section with "output done" or "output fail"
  19. #
  20. # 4) The function "output" will show the results on the terminal
  21. #   If you use "output" it will show "wait" on the terminal for every app= on this script
  22. #   If you use "output done" it will show "done" on the terminal for the last app used
  23. #   If you use "output fail" it will show "fail" on the terminal for the last app used
  24. #
  25. # Example, we will check if gedit is installed, if it's not, we will try to install it
  26. # if it's installed or we manage to install it, we will use output done
  27. # if the instalation fails, we will use output fail
  28. #
  29. # app=<name here, do not use caps>
  30. # if isInstalled gedit; then
  31. #   output done
  32. # else
  33. #   if apt-get install -y gedit; then
  34. #      output done
  35. #   else
  36. #      output fail
  37. #   fi
  38. # fi
  39.  
  40. # Get architecture
  41. [ $(uname -m) = "i686" ] && arch="i386" || arch="amd64"
  42.  
  43. # output variables, do not touch
  44. wt='\e[0;33mwait'
  45. ok='\e[1;32mdone'
  46. ko='\e[1;31mfail'
  47. # generate apps array
  48. a=("$(sed '/app=[a-z]/!d;s/app=//g' $0)")
  49. # generate apps status array
  50. for x in ${a[@]}; do
  51.   b=("${b[@]}" "$wt")
  52. done
  53. # stores array position of "status" relative to an "app"
  54. j=0
  55.  
  56.  
  57. # output: show status of app configuration: wait, done, fail
  58. output(){
  59.  
  60.   clear
  61.  
  62.   case $1 in
  63.     done) b[((j++))]="$ok";;
  64.     fail) b[((j++))]="$ko";;
  65.     *) ;;
  66.   esac
  67.  
  68.   echo -e "\n\e[1;37m KaliConf \e[1;30mby Noes1s"  
  69.   i=0
  70.   for x in ${a[@]}; do
  71.     printf "\e[0;36m [ ${b[((i++))]}\e[0;36m ]"
  72.     printf "\e[0;36m\e[0;36m $x\n"
  73.   done
  74.   echo ""
  75.  
  76. }
  77.  
  78.  
  79. # Confirm if the program is installed, return 0 = yes, 1+ = no
  80. isInstalled(){
  81.  
  82.   type -p $1 > /dev/null
  83.   return $?
  84.  
  85. }
  86.  
  87.  
  88. # Create a new gnome-terminal profile
  89. newProfile(){
  90.  
  91.   gconftool-2 --dump /apps/gnome-terminal/profiles/Default | sed "s/Default/$1/g" > /tmp/dump
  92.   gconftool-2 --load /tmp/dump
  93.   rm /tmp/dump
  94.   gconftool-2 --set /apps/gnome-terminal/global/profile_list --type list --list-type string $(echo [$(echo $(gconftool-2 -R /apps/gnome-terminal/profiles |sed -e '/profiles/!d;s/.*\/\(.*\):/\1/') |sed 's/ /,/g')])
  95.   gconftool-2 --set -t string /apps/gnome-terminal/global/default_profile $1
  96.  
  97. }
  98.  
  99. # starting output, all apps on "wait"
  100. output
  101.  
  102.  
  103. #
  104. # TouchPad
  105. #
  106. app=touchpad-scroll
  107. edit='gsettings set org.gnome.settings-daemon.peripherals.touchpad'
  108. $edit scroll-method two-finger-scrolling 2>/dev/null && output done || output fail
  109.  
  110. # Fix Elantech
  111. app=elantech-fix
  112. [ ! -f /etc/modprobe.d/options.conf ] &&
  113.   echo 'options psmouse proto=imps' >> /etc/modprobe.d/options.conf &&
  114.     output done
  115.  
  116. ! grep 'proto=imps' /etc/modprobe.d/options.conf &&
  117.   echo 'options psmouse proto=imps' >> /etc/modprobe.d/options.conf &&
  118.     output done || output fail
  119.  
  120. # Spanish locale
  121. app=es_ES
  122.   (
  123.   echo 'LANG="en_US.UTF-8"
  124. LC_TIME="es_ES.UTF-8"
  125. LC_PAPER="es_ES.UTF-8"
  126. LC_MEASUREMENT="es_ES.UTF-8"
  127. LC_MONETARY="es_ES.UTF-8"' > /etc/default/locale
  128.   gsettings set org.gnome.system.locale region 'es_ES.utf8'
  129.   gsettings set org.gnome.libgnomekbd.keyboard layouts "['es']"
  130.   ) && output done || output fail
  131.  
  132.  
  133. # Enable real transparency
  134. app=transparency
  135. gsettings set org.gnome.metacity compositing-manager true && output done || output fail
  136.  
  137.  
  138. #
  139. # Terminal Theme: BlueGhost
  140. #
  141. app=gnome-terminal
  142. isInstalled $app && isInstalled gconftool-2 &&
  143.   (
  144.   name='BlueGhost'
  145.   newProfile $name
  146.   path="/apps/gnome-terminal/profiles/$name"
  147.   gstring="gconftool-2 -t string -s $path"
  148.   gbool="gconftool-2 -t bool -s $path"
  149.   gint="gconftool-2 -t int -s $path"
  150.   # Terminal-General
  151.   $gbool/use_system_font "true"
  152.   $gbool/allow_bold "true"
  153.   $gbool/default_show_menubar "false"
  154.   $gbool/use_custom_default_size "true"
  155.   $gint/default_size_columns "100"
  156.   $gint/default_size_rows "20"
  157.   $gbool/silent_bell "true"
  158.   # Terminal-Title
  159.   $gstring/title "#!"
  160.   $gstring/title_mode "ignore"
  161.   # Terminal-Colors
  162.   $gbool/use_theme_colors "false"
  163.   $gstring/foreground_color "#00008A51FFFF"
  164.   $gstring/background_color "#000000000000"
  165.   $gbool/bold_color_same_as_fg "true"
  166.   # Terminal-Background
  167.   $gbool/use_theme_background "false"
  168.   $gstring/background_type "transparent"
  169.   $gint/background_darkness "0.76165801286697388"
  170.   # Terminal-Scrolling
  171.   $gstring/scrollbar_position "hidden"
  172.   $gbool/scrollback_unlimited "true"
  173.   ) && output done || output fail
  174.  
  175.  
  176. # Repository
  177. app=repository
  178. path='/etc/apt/sources.list'
  179. #'deb http://ftp.debian.org/debian wheezy main contrib non-free'
  180. #'deb http://ftp.debian.org/debian sid main contrib non-free'
  181. #'deb http://ftp.debian.org/debian experimental main contrib non-free'
  182. repositories=(
  183. 'deb http://http.kali.org/ /kali main contrib non-free'
  184. 'deb http://http.kali.org/ /wheezy main contrib non-free'
  185. 'deb http://http.kali.org/kali kali-dev main contrib non-free'
  186. 'deb http://http.kali.org/kali kali-dev main/debian-installer'
  187. 'deb-src http://http.kali.org/kali kali-dev main contrib non-free'
  188. 'deb http://http.kali.org/kali kali main contrib non-free'
  189. 'deb http://http.kali.org/kali kali main/debian-installer'
  190. 'deb-src http://http.kali.org/kali kali main contrib non-free'
  191. 'deb http://security.kali.org/kali-security kali/updates main contrib non-free'
  192. 'deb-src http://security.kali.org/kali-security kali/updates main contrib non-free'
  193. 'deb http://repos.codelite.org/debian/ wheezy contrib'
  194. )
  195. for i in "${repositories[@]}"; do
  196.   grep "$i" $path || echo "$i" >> $path
  197. done
  198. apt-get update
  199. output done
  200.  
  201.  
  202.  
  203. #
  204. # Gedit
  205. #
  206. app=gedit
  207. isInstalled $app || apt-get install gedit -y
  208. isInstalled $app &&
  209.   (
  210.   edit='gsettings set org.gnome.gedit.preferences.editor'
  211.   $edit auto-indent true
  212.   $edit auto-save true
  213.   #$edit auto-save-interval
  214.   $edit bracket-matching true
  215.   #$edit create-backup-copy
  216.   $edit display-line-numbers true
  217.   $edit display-right-margin false
  218.   $edit ensure-trailing-newline true
  219.   $edit highlight-current-line true
  220.   $edit insert-spaces true
  221.   #$edit max-undo-actions
  222.   #$edit restore-cursor-position
  223.   #$edit right-margin-position
  224.   $edit scheme 'cobalt'deb http://repos.codelite.org/debian/ wheezy contrib
  225.   $edit search-highlighting true
  226.   #$edit smart-home-end
  227.   $edit syntax-highlighting true
  228.   $edit tabs-size 'uint32 2'
  229.   #$edit undo-actions-limit
  230.   $edit wrap-mode 'word'
  231.   #aptitude install ttf-inconsolata -y
  232.   #$edit editor-font 'Inconsolata Medium 14'
  233.   #$edit use-default-font false
  234.   ) && output done || output fail
  235.  
  236.  
  237.  
  238. #
  239. # Prompt
  240. #
  241. app=prompt
  242. # delete duplicates (unfinished)
  243. #sed '/#noes1sSTART/,/#noes1sEND/d' ~/.bash_aliases 1>~/.bash_aliases 2>/dev/null
  244. # add new aliases
  245. ! grep noes1s ~/.bash_aliases >/dev/null && (
  246. echo '#noes1sSTART
  247. #  ,___    
  248. #  ¡  _`    
  249. #  ª_/()    Kaliconfig aliases
  250. #  |\` `,   by Noes1s
  251. # _·    l  
  252.  
  253. # this bash_aliases file should be loaded by a default .bashrc
  254.  
  255. # prompt    
  256. PS1="\[\e[0;36m\]┌╸\[\e[1;36m\]\u\[\e[0;36m\]╺─╸\[\e[1;37m\]\w\[\e[0;36m\]╺\n└─╍\[\e[0m\] "
  257.  
  258.  
  259. # apt-get
  260. alias upd="sudo apt-get update"
  261. alias upg="sudo apt-get upgrade"
  262. alias ins="sudo apt-get install"
  263. alias rem="sudo apt-get purge"
  264. alias fix="sudo apt-get install -f"
  265.  
  266. # cd
  267. alias ..="cd .."
  268. alias ...="cd ../.."
  269. alias ....="cd ../../.."
  270. alias .....="cd ../../../.."
  271.  
  272. # grep
  273. alias grep="grep --color=auto"
  274. alias fgrep="fgrep --color=auto"
  275. alias egrep="egrep --color=auto"
  276.  
  277. # ls
  278. alias ll="ls -alF"
  279. alias la="ls -A"
  280. alias l="ls -CF"
  281. #noes1sEND
  282. ' > ~/.bash_aliases
  283.   ) && output done || output fail
  284.  
  285.  
  286. # Wallpaper
  287. app=wallpaper
  288. [ ! -f /usr/share/wallpapers/noes1s.jpg ] && (
  289.   wget -qO /usr/share/wallpapers/noes1s.jpg http://i.imgur.com/7tVfiBL.jpg
  290.   gsettings set org.gnome.desktop.background picture-uri file:///usr/share/wallpapers/noes1s.jpg
  291.   gconftool-2 -t string -s /desktop/gnome/background/picture_filename /usr/share/wallpapers/noes1s.jpg
  292.   ) && output done || output fail
  293.  
  294.  
  295. # Gnome theme editor
  296. app=gnome-tweak-tool
  297. apt-get install gnome-tweak-tool -y && output done || output fail
  298.  
  299.  
  300. # Delorean-dark Theme
  301. # http://killhellokitty.deviantart.com/art/DeLorean-Dark-1-55-318612217
  302. app=delorean-dark-theme
  303. [ ! -d /usr/share/themes/delorean-dark ] && (
  304.   aptitude install -y gtk3-engines-unico gtk2-engines-murrine gtk2-engines-pixbuf
  305.   wget http://www.deviantart.com/download/318612217/delorean_dark_1_55_by_killhellokitty-d59oyrd.zip -O /tmp/delorean.zip
  306.   unzip /tmp/delorean.zip -d /usr/share/themes
  307.   rm /tmp/delorean.zip
  308.   ) && output done || output fail
  309.  
  310.  
  311. # Chromium Browser
  312. app=chromium-browser
  313. aptitude install -y chromium-browser && output done || output fail
  314. echo '# Default settings for chromium.
  315. # This file is sourced by /bin/sh from /usr/bin/chromium
  316.  
  317. # Options to pass to chromium
  318. CHROMIUM_FLAGS="--user-data-dir=/root/.config/chromium"' > /etc/chromium/default
  319.   # Enable PDF Plugin
  320.   # http://www.webdweb.com/2012/10/pdf-viewer-in-chromium/
  321.   # wget libpdf.so -O /usr/lib/chromium/libpdf.so
  322.   #BugFix https://aur.archlinux.org/packages/chromium-stable-libpdf/ @uffuji
  323.   apt-get install ttf-droid ttf-liberation ttf-dejavu #ttf-ms-fonts <- pkg not found
  324.  
  325. # GUI for compressed files
  326. app=file-roller
  327. aptitude install -y file-roller && output done || output fail
  328.  
  329.  
  330. # Codelite IDE
  331. app=codelite
  332. r=''
  333. apt-key adv --fetch-keys http://repos.codelite.org/CodeLite.asc
  334. apt-get install codelite wxcrafter && output done || output fail
  335.  
  336.  
  337.  
  338. # transset-df
  339.  
  340.  
  341. # Compton (Composite-manager, real transparency + shadows)
  342. # https://github.com/chjj/compton/blob/master/README.md
  343. #cd /tmp
  344. #git clone https://github.com/chjj/compton/
  345. #cd /compton
  346. # Required for compton RUNTIME
  347. #aptitude install -y libx11-dev libxcomposite-dev libxdamage-dev libxfixes-dev libxext-dev libxrender-dev libxrandr-dev bash libpcre3-dev libconfig-dev libgl1-mesa-dev libdbus-1-dev
  348. # Required for compton BUILD-TIME (MAKE)
  349. #aptitude install -y pkg-config make libdrm-dev
  350. # Required for MAN (MAKE INSTALL)
  351. #aptitude install -y libxml2-utils docbook-xml xsltproc docbook-xsl asciidoc
  352.  
  353. # VirtualBox Guest
  354. #apt-get install -y linux-headers-$(uname -r)
  355. #cp /media/cdrom/VBoxLinuxAdditions.run /root/
  356. #chmod 755 /root/VBoxLinuxAdditions.run
  357. #cd /root
  358. #./VBoxLinuxAdditions.run
  359. #reboot
  360.  
  361.  
  362.  
  363. # reset terminal
  364. bash
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement