CrunchBang Linux Pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

CrunchBang Linux Pastebin

Posted by johnraff on Fri 7th May 05:38 (modification of post by jmbarnes view diff)
diff | download | new post

  1. #!/bin/bash
  2.  
  3. ###INTRO
  4. echo "This script installs a number of additional packages"
  5. echo "to make a default crunchbang install ready for academic"
  6. echo "or office heavy work."
  7. echo ""
  8. echo "It is produced for my personal use (and hence reflects my"
  9. echo "favorite packages) but thought others may find it of use."
  10. echo "It also includes some basic built-in configuration editing"
  11. echo "I find necessary to new installs."
  12. echo ""
  13. echo "Many thanks to OMNS for his post-install script that this script"
  14. echo "draws its inspiration from."
  15. echo ""
  16. echo "Before continuing some things to note:"
  17. echo "1) Please edit the script as necessary--removing packages or adding"
  18. echo "2) Note that you must run this script as root or via sudo."
  19. echo "3) Diable all non-default repos (e.g.unstable/sid)"
  20. echo "4) This script is interactive--it will require your input."
  21. echo "5) Answer all question in lowercase."
  22. echo "6) Have any config files you'd like to use mounted / accessible."
  23. echo ""
  24. echo -n "Run installer now? (y/n) > "
  25. read a
  26. if [ "$a" = "y" ] || [ "$a" = "Y" ] || \
  27. [ "$a" = "" ]; then
  28.         :
  29. else
  30.         { echo "bye"; exit 0; }
  31. fi
  32.  
  33. ##Adding repostories
  34.         echo "Adding mendeley and chromium repositoires..."
  35.         echo "deb http://www.mendeley.com/repositories/Debian_5.0 /" >> /etc/apt/sources.list
  36.         echo "deb http://ppa.launchpad.net/chromium-daily/beta/ubuntu/ jaunty main" >> /etc/apt/sources.list
  37.        
  38. ##Updating and upgrading
  39.     echo "Updating repositories and upgrading..."
  40.     echo ""
  41.     sleep 2s
  42.     apt-get update
  43.     apt-get dist-upgrade
  44.     echo ""
  45.     echo "Upgrading complete..."
  46.     echo ""
  47.    
  48. #####Installing stuff
  49.         echo "Package installations:"
  50.         echo ""
  51.         sleep 2s
  52. ##Zenity--necessary for some gui file selection later
  53.     echo "Installing zenity (necessary for configuration bits)..."
  54.     echo ""
  55.     sleep 2s
  56.     apt-get install -y zenity
  57.     echo ""
  58.     echo "Zenity installed..."
  59.     echo ""
  60. ##Programs for text-writing / researching
  61.     echo "Installing extra Zim and Geany..."
  62.     echo ""
  63.     sleep 2s
  64.     apt-get install -y zim geany
  65.     echo ""
  66.     echo "Zim and geany installed..."
  67.     echo ""
  68. ##Openoffice
  69.     echo "Installing openoffice.org..."
  70.     echo ""
  71.     sleep 2s
  72.     apt-get install -y openoffice.org
  73.     echo ""
  74.     echo "Openoffice.org installed..."
  75.     echo ""
  76. ##Mendeley
  77.     echo "Installing Mendeley desktop..."
  78.     echo ""
  79.     sleep 2s
  80.     apt-get install -y mendeleydesktop
  81.     echo ""
  82.     echo "Mendeley installed..."
  83.     echo ""
  84. ##Chromium
  85.     echo "Installing Chromium browser..."
  86.     echo ""
  87.     sleep 2s
  88.     apt-get install -y chromium-browser chromium-codecs-ffmpeg-nonfree chromium-codecs-ffmpeg-extra
  89.     echo ""
  90.     echo "Chromium installed..."
  91.     echo ""
  92. ##Communication apps
  93.     echo "Installing Comunication apps..."
  94.     echo ""
  95.     sleep 2s
  96.     apt-get install -y pidgin claws-mail irssi wget
  97.     echo ""
  98.     echo "Communication apps installed..."
  99.     echo ""
  100. ##Printing apps
  101.     echo "Installing Printing packages..."
  102.     echo ""
  103.     sleep 2s
  104.     apt-get install -y cups cups-pdf system-config-printer hpijs ntfs-3g
  105.     echo ""
  106.     echo "All Printing packages installed..."
  107.     echo ""
  108.     sleep 2s
  109. ##Dropbox
  110.         echo "Dropbox installation..."
  111.         echo ""
  112.         read -p "Are you on "32"-bit or "64"-bit? (32 / 64): " bits
  113.                 if [ "$bits" = "64" ]; then
  114.                         echo "Sorry...only 32-bit Dropbox install is automated in this script."
  115.                         else
  116.                                 if [ "$bits" = "32" ]; then
  117.                                         cd ~/
  118.                                         echo "Downloading Dropbox..."
  119.                                         wget http://www.getdropbox.com/download?plat=lnx.x86
  120.                                         tar -zxvf dropbox-lnx.x86-0.7.110.tar.gz
  121.                                         echo ""
  122.                                         sleep 1s
  123.                                         echo "Creating fake script to cancel-out nautilus..."
  124.                                         touch ~/bin/nautilus
  125.                                         chmod +x ~/bin/nautilus
  126.                                         echo "#!/bin/bash" >> ~/bin/nautilus
  127.                                         echo "exec thunar $@" >> ~/bin/nautilus
  128.                                         echo "exit 0" >> ~/bin/nautilus
  129.                                         echo ""
  130.                                         sleep 1s
  131.                                         echo "Updating autostart.sh with commands to keep"
  132.                                         echo "nautilus from taking over the desktop"
  133.                                         echo "gconftool-2 -s -t bool /apps/nautilus/preferences/show_desktop false &" >> ~/.config/openbox/autostart.sh
  134.                                         echo "gconftool-2 -s -t bool /desktop/gnome/background/draw_background false &" >> ~/.config/openbox/autostart.sh
  135.                                         echo "gconftool-2 -s -t bool /apps/nautilus/preferences/always_use_browser false &" >> ~/.config/openbox/autostart.sh
  136.                                         echo "gconftool-2 -s -t bool /apps/nautilus/preferences/show_advanced_permissions true &"  >> ~/.config/openbox/autostart.sh
  137.                                         echo "(sleep 60s && ~/.dropbox-dist/dropboxd) &" >> ~/.config/openbox/autostart.sh
  138.                                         echo ""
  139.                                         sleep 1s
  140.                                         echo "Dropbox installation complete. Requires log-in to take effect."
  141.                                         echo ""
  142.                                 fi
  143.                 fi
  144.         echo ""
  145.         sleep 2s               
  146. ##Stuff to remove
  147.     echo "Removing redundant apps..."
  148.     echo ""
  149.     sleep 2s
  150.     apt-get remove -y abiword gnumeric
  151.     echo ""
  152.     echo "Rendundent applications removed..."
  153.     echo ""
  154. ##Cleanup time
  155.     echo "Cleaning up packages..."
  156.     echo ""
  157.     sleep 2s
  158.     apt-get autoclean
  159.     apt-get autoremove
  160.     echo ""
  161.     echo "Packages cleaned up..."
  162.     echo ""
  163. ############
  164.  
  165. ######Configuration section
  166.         echo "Configurations..."
  167.         echo ""
  168.         sleep 2s
  169. ##Alias
  170.         read -p "Would you like to copy over bash aliases? (y/n): " aliascopy
  171.     if [ "$aliascopy" = "y" ]; then
  172.                 oldaliases=$(zenity --file-selection);
  173.         if [ $? = 1 ]; then
  174.            echo "Aliases not copied. Default will be used."
  175.                    else
  176.                                 echo ""
  177.                                 echo ""
  178.                                 echo "Writing in bash aliases"
  179.                                 cp $oldaliases ~/.bash_aliases
  180.                                 echo "To enable aliases you must edit the .bashrc file."
  181.                                 echo "It will open automatically in a second. In it"
  182.                                 echo "please uncomment the following lines (73-75) ..."
  183.                                 echo ""
  184.                                 echo "if [ -f ~/.bash_aliases ]; then"
  185.                                 echo ". ~/.bash_aliases"
  186.                                 echo "fi"
  187.                                 echo ""
  188.                                 echo "Save and close gedit to continue."
  189.                                 sleep 3s
  190.                                 gedit ~/.bashrc
  191.                 fi
  192.     fi
  193.     echo "Alias configuration complete."
  194.     echo ""
  195.     sleep 2s
  196. ##Xmodmap
  197.         echo "Conversion of caps-lock to super-key.."
  198.         echo "This is particularily useful for keyboards"
  199.         echo "lacking a "Windows" key (older thinkpads etc.)"
  200.         read -p "Do the conversion? (y/n): " capsconvert
  201.         if [ "$capsconvert" = "y" ];then
  202.                 echo "Creating ~/.Xmodmap file"
  203.                 sleep 1s
  204.                 touch ~/.Xmodmap
  205.                 echo "! No Caps Lock" >> ~/.Xmodmap
  206.                 echo "clear lock" >> ~/.Xmodmap
  207.                 echo "! Caps Lock as Win Key" >> ~/.Xmodmap
  208.                 echo "add mod4 = Caps_Lock" >> ~/.Xmodmap
  209.                 echo "Adding ~/.Xmodmap to autostart.sh"
  210.                 echo "(sleep 1s && xmodmap ~/.Xmodmap ) &" >> ~/.config/openbox/autostart.sh
  211.         fi
  212.         echo ""
  213.         sleep 1s
  214.                
  215. ##Openbox
  216.     echo "Configuration of openbox..."
  217.     echo ""
  218.     echo "Reusing autostarts and menus is not recommended,"
  219.         echo "but rc.xml's are quite mobile."
  220.     echo ""
  221.     sleep 2s
  222.     echo "RC.........."
  223.     read -p "Would you like to reuse and old rc.xml file? (y/n): " rccopy
  224.     if [ "$rccopy" = "y" ]; then
  225.                 rcold=$(zenity --file-selection);
  226.         if [ $? = 1 ]; then
  227.            echo "Rc.xml not copied. Default will be used."
  228.                    else
  229.                                 echo "Backing up and updating rc.xml..."
  230.                                 cp ~/.config/openbox/rc.xml ~/.config/openbox/rc_Default.xml
  231.                                 rm -f ~/.config/openbox/rc.xml
  232.                                 cp $rcold ~/.config/openbox/rc.xml
  233.  
  234.                 fi
  235.     fi
  236.     sleep 2s
  237.     echo ""
  238.     echo "MENU.........."
  239.     echo "Probably a good idea to update your Openbox menu now."
  240.     sleep 1s
  241.     echo ""
  242.     echo "Here is a list of application names you may wish to add:"
  243.     echo "zim, geany, ooffice, mendeleydesktop, "
  244.     echo "pidgin, claws-mail, irssi, system-config-printer"
  245.     sleep 1s
  246.     echo "You may want to remove: abiword, gnumeric"
  247.     echo ""
  248.     sleep 1s
  249.     echo "Save and close obmenu to continue..."
  250.     sleep 2s
  251.     obmenu
  252.     echo ""
  253.     sleep 2s
  254.     echo "AUTOSTART........"
  255.     echo "Your autostart.sh may require changes or additions."
  256.     echo "Save and close gedit to continue..."
  257.     sleep 2s
  258.     gedit ~/.config/openbox/autostart.sh
  259.     echo ""
  260.     sleep 1s
  261.     echo "Openbox configured."
  262.     echo ""
  263.     sleep 1s
  264.     echo "Restarting openbox..."
  265.     openbox --restart
  266.     echo ""
  267.     sleep 2s
  268.    
  269. echo "Hope all went well--time to start testing installed applications."
  270. echo "Enjoy."
  271. ##
  272.  #fi
  273. exit

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me