#!/bin/sh
echo ""
echo "*** Ubuntu 8.04 LTS Tweak ***"
echo "***     version 0.0.1     ***"
echo "***      www.x2on.de      ***"
echo ""
echo "thx to http://ubuntu-eee.tuxfamily.org/"
echo "thx to http://code.google.com/p/eee-osd/"
echo ""
echo "** Gnome settings"
echo "* Setting smaller font sizes"
gconftool-2 --set /apps/nautilus/preferences/desktop_font --type string "Sans 8"
gconftool-2 --set /desktop/gnome/interface/document_font_name --type string "Sans 8"
gconftool-2 --set /desktop/gnome/interface/font_name --type string "Sans 8"
gconftool-2 --set /apps/metacity/general/titlebar_font --type string "Sans Bold 8"
gconftool-2 --set /desktop/gnome/interface/monospace_font_name --type string "Monospace 9"
echo "* Smaller toolbars icons only"
gconftool-2 --set /desktop/gnome/interface/toolbar_style --type string "icons"
echo "* Disabling UI sounds"
gconftool-2 --set /desktop/gnome/sound/event_sounds --type bool 0
echo "* Fixing mute key"
gconftool-2 --set /desktop/gnome/sound/default_mixer_tracks --type list --list-type string "[PCM]"
echo "* Fullscreen with <Alt>-F11"
gconftool-2 --set /apps/metacity/window_keybindings/toggle_fullscreen --type string "<Alt>F11"
echo "* Setting suspend when closing lid, blank screen"
gconftool-2 --set /apps/gnome-power-manager/actions/sleep_type_battery --type string "suspend"
gconftool-2 --set /apps/gnome-power-manager/actions/sleep_type_ac --type string "suspend"
gconftool-2 --set /apps/gnome-power-manager/buttons/lid_battery --type string "suspend"
gconftool-2 --set /apps/gnome-power-manager/buttons/lid_ac --type string "blank"
gconftool-2 --set /apps/gnome-power-manager/timeout/sleep_computer_ac --type int 0
gconftool-2 --set /apps/gnome-power-manager/timeout/sleep_computer_battery --type int 300
gconftool-2 --set /apps/gnome-power-manager/timeout/sleep_display_ac --type int 300
gconftool-2 --set /apps/gnome-power-manager/timeout/sleep_display_battery --type int 60
echo "* Don't display battery warning"
gconftool-2 --set /apps/gnome-power-manager/notify/low_capacity --type bool 0
echo "* Unconstraining windows to the top of the screen"
gconftool-2 --type bool --set /apps/compiz/plugins/move/allscreens/options/constrain_y 0
echo "Gnome-settings done."
echo "** Installing ACPI modules"
sudo apt-get update
sudo apt-get install -y -f build-essential module-assistant eeepc-acpi-source  --force-yes
sudo m-a a-i eeepc-acpi
sudo cp /etc/modules ~/modules.tmp
sudo chmod 777 ~/modules.tmp
echo "eeepc-acpi" >> ~/modules.tmp
sudo chmod 644 ~/modules.tmp
sudo mv ~/modules.tmp /etc/modules
echo "** Installing WLAN"
sudo apt-get update
sudo apt-get install build-essential
wget http://snapshots.madwifi.org/madwifi-hal-0.10.5.6-current.tar.gz
tar zxvf madwifi-hal-0.10.5.6-current.tar.gz
cd madwifi-hal-0.10.5.6-r*
make clean
make
sudo make install
cd ..
sudo rm -r madwifi-hal-0.10.5.6-r* madwifi-hal-0.10.5.6-current.tar.gz
echo "** Installing OSD"
wget http://eee-osd.googlecode.com/files/eee-osd_2.1-0eeeXubuntu1_i386.deb
sudo dpkg -i eee-osd_2.1-0eeeXubuntu1_i386.deb
echo "** Configuring Sound for EeePC 701"
echo "options snd-hda-intel model=3stack-dig" > ~/snd-hda-intel.tmp
sudo mv ~/snd-hda-intel.tmp /etc/modprobe.d/snd-hda-intel
echo "Done! Please reboot now"

