Posted by johnraff on Fri 7th May 05:38 (modification of post by jmbarnes view diff)
diff | download | new post
- #!/bin/bash
- ###INTRO
- echo "This script installs a number of additional packages"
- echo "to make a default crunchbang install ready for academic"
- echo "or office heavy work."
- echo ""
- echo "It is produced for my personal use (and hence reflects my"
- echo "favorite packages) but thought others may find it of use."
- echo "It also includes some basic built-in configuration editing"
- echo "I find necessary to new installs."
- echo ""
- echo "Many thanks to OMNS for his post-install script that this script"
- echo "draws its inspiration from."
- echo ""
- echo "Before continuing some things to note:"
- echo "1) Please edit the script as necessary--removing packages or adding"
- echo "2) Note that you must run this script as root or via sudo."
- echo "3) Diable all non-default repos (e.g.unstable/sid)"
- echo "4) This script is interactive--it will require your input."
- echo "5) Answer all question in lowercase."
- echo "6) Have any config files you'd like to use mounted / accessible."
- echo ""
- echo -n "Run installer now? (y/n) > "
- read a
- if [ "$a" = "y" ] || [ "$a" = "Y" ] || \
- [ "$a" = "" ]; then
- :
- else
- { echo "bye"; exit 0; }
- fi
- ##Adding repostories
- echo "Adding mendeley and chromium repositoires..."
- echo "deb http://www.mendeley.com/repositories/Debian_5.0 /" >> /etc/apt/sources.list
- echo "deb http://ppa.launchpad.net/chromium-daily/beta/ubuntu/ jaunty main" >> /etc/apt/sources.list
- ##Updating and upgrading
- echo "Updating repositories and upgrading..."
- echo ""
- sleep 2s
- apt-get update
- apt-get dist-upgrade
- echo ""
- echo "Upgrading complete..."
- echo ""
- #####Installing stuff
- echo "Package installations:"
- echo ""
- sleep 2s
- ##Zenity--necessary for some gui file selection later
- echo "Installing zenity (necessary for configuration bits)..."
- echo ""
- sleep 2s
- apt-get install -y zenity
- echo ""
- echo "Zenity installed..."
- echo ""
- ##Programs for text-writing / researching
- echo "Installing extra Zim and Geany..."
- echo ""
- sleep 2s
- apt-get install -y zim geany
- echo ""
- echo "Zim and geany installed..."
- echo ""
- ##Openoffice
- echo "Installing openoffice.org..."
- echo ""
- sleep 2s
- apt-get install -y openoffice.org
- echo ""
- echo "Openoffice.org installed..."
- echo ""
- ##Mendeley
- echo "Installing Mendeley desktop..."
- echo ""
- sleep 2s
- apt-get install -y mendeleydesktop
- echo ""
- echo "Mendeley installed..."
- echo ""
- ##Chromium
- echo "Installing Chromium browser..."
- echo ""
- sleep 2s
- apt-get install -y chromium-browser chromium-codecs-ffmpeg-nonfree chromium-codecs-ffmpeg-extra
- echo ""
- echo "Chromium installed..."
- echo ""
- ##Communication apps
- echo "Installing Comunication apps..."
- echo ""
- sleep 2s
- apt-get install -y pidgin claws-mail irssi wget
- echo ""
- echo "Communication apps installed..."
- echo ""
- ##Printing apps
- echo "Installing Printing packages..."
- echo ""
- sleep 2s
- apt-get install -y cups cups-pdf system-config-printer hpijs ntfs-3g
- echo ""
- echo "All Printing packages installed..."
- echo ""
- sleep 2s
- ##Dropbox
- echo "Dropbox installation..."
- echo ""
- read -p "Are you on "32"-bit or "64"-bit? (32 / 64): " bits
- if [ "$bits" = "64" ]; then
- echo "Sorry...only 32-bit Dropbox install is automated in this script."
- else
- if [ "$bits" = "32" ]; then
- cd ~/
- echo "Downloading Dropbox..."
- wget http://www.getdropbox.com/download?plat=lnx.x86
- tar -zxvf dropbox-lnx.x86-0.7.110.tar.gz
- echo ""
- sleep 1s
- echo "Creating fake script to cancel-out nautilus..."
- touch ~/bin/nautilus
- chmod +x ~/bin/nautilus
- echo "#!/bin/bash" >> ~/bin/nautilus
- echo "exec thunar $@" >> ~/bin/nautilus
- echo "exit 0" >> ~/bin/nautilus
- echo ""
- sleep 1s
- echo "Updating autostart.sh with commands to keep"
- echo "nautilus from taking over the desktop"
- echo "gconftool-2 -s -t bool /apps/nautilus/preferences/show_desktop false &" >> ~/.config/openbox/autostart.sh
- echo "gconftool-2 -s -t bool /desktop/gnome/background/draw_background false &" >> ~/.config/openbox/autostart.sh
- echo "gconftool-2 -s -t bool /apps/nautilus/preferences/always_use_browser false &" >> ~/.config/openbox/autostart.sh
- echo "gconftool-2 -s -t bool /apps/nautilus/preferences/show_advanced_permissions true &" >> ~/.config/openbox/autostart.sh
- echo "(sleep 60s && ~/.dropbox-dist/dropboxd) &" >> ~/.config/openbox/autostart.sh
- echo ""
- sleep 1s
- echo "Dropbox installation complete. Requires log-in to take effect."
- echo ""
- fi
- fi
- echo ""
- sleep 2s
- ##Stuff to remove
- echo "Removing redundant apps..."
- echo ""
- sleep 2s
- apt-get remove -y abiword gnumeric
- echo ""
- echo "Rendundent applications removed..."
- echo ""
- ##Cleanup time
- echo "Cleaning up packages..."
- echo ""
- sleep 2s
- apt-get autoclean
- apt-get autoremove
- echo ""
- echo "Packages cleaned up..."
- echo ""
- ############
- ######Configuration section
- echo "Configurations..."
- echo ""
- sleep 2s
- ##Alias
- read -p "Would you like to copy over bash aliases? (y/n): " aliascopy
- if [ "$aliascopy" = "y" ]; then
- oldaliases=$(zenity --file-selection);
- if [ $? = 1 ]; then
- echo "Aliases not copied. Default will be used."
- else
- echo ""
- echo ""
- echo "Writing in bash aliases"
- cp $oldaliases ~/.bash_aliases
- echo "To enable aliases you must edit the .bashrc file."
- echo "It will open automatically in a second. In it"
- echo "please uncomment the following lines (73-75) ..."
- echo ""
- echo "if [ -f ~/.bash_aliases ]; then"
- echo ". ~/.bash_aliases"
- echo "fi"
- echo ""
- echo "Save and close gedit to continue."
- sleep 3s
- gedit ~/.bashrc
- fi
- fi
- echo "Alias configuration complete."
- echo ""
- sleep 2s
- ##Xmodmap
- echo "Conversion of caps-lock to super-key.."
- echo "This is particularily useful for keyboards"
- echo "lacking a "Windows" key (older thinkpads etc.)"
- read -p "Do the conversion? (y/n): " capsconvert
- if [ "$capsconvert" = "y" ];then
- echo "Creating ~/.Xmodmap file"
- sleep 1s
- touch ~/.Xmodmap
- echo "! No Caps Lock" >> ~/.Xmodmap
- echo "clear lock" >> ~/.Xmodmap
- echo "! Caps Lock as Win Key" >> ~/.Xmodmap
- echo "add mod4 = Caps_Lock" >> ~/.Xmodmap
- echo "Adding ~/.Xmodmap to autostart.sh"
- echo "(sleep 1s && xmodmap ~/.Xmodmap ) &" >> ~/.config/openbox/autostart.sh
- fi
- echo ""
- sleep 1s
- ##Openbox
- echo "Configuration of openbox..."
- echo ""
- echo "Reusing autostarts and menus is not recommended,"
- echo "but rc.xml's are quite mobile."
- echo ""
- sleep 2s
- echo "RC.........."
- read -p "Would you like to reuse and old rc.xml file? (y/n): " rccopy
- if [ "$rccopy" = "y" ]; then
- rcold=$(zenity --file-selection);
- if [ $? = 1 ]; then
- echo "Rc.xml not copied. Default will be used."
- else
- echo "Backing up and updating rc.xml..."
- cp ~/.config/openbox/rc.xml ~/.config/openbox/rc_Default.xml
- rm -f ~/.config/openbox/rc.xml
- cp $rcold ~/.config/openbox/rc.xml
- fi
- fi
- sleep 2s
- echo ""
- echo "MENU.........."
- echo "Probably a good idea to update your Openbox menu now."
- sleep 1s
- echo ""
- echo "Here is a list of application names you may wish to add:"
- echo "zim, geany, ooffice, mendeleydesktop, "
- echo "pidgin, claws-mail, irssi, system-config-printer"
- sleep 1s
- echo "You may want to remove: abiword, gnumeric"
- echo ""
- sleep 1s
- echo "Save and close obmenu to continue..."
- sleep 2s
- obmenu
- echo ""
- sleep 2s
- echo "AUTOSTART........"
- echo "Your autostart.sh may require changes or additions."
- echo "Save and close gedit to continue..."
- sleep 2s
- gedit ~/.config/openbox/autostart.sh
- echo ""
- sleep 1s
- echo "Openbox configured."
- echo ""
- sleep 1s
- echo "Restarting openbox..."
- openbox --restart
- echo ""
- sleep 2s
- echo "Hope all went well--time to start testing installed applications."
- echo "Enjoy."
- ##
- #fi
- 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.