#!/bin/bash
# Criado em:Qui 23/Abr/2009 hs 22:58
# Last Change: Sex 24 Abr 2009 06:08:20 BRT
# vim:ft=sh:fdm=syntax:nu:
# Instituicao: none
# Proposito do script: instalar codecs e outros programas no ubuntu jaunty 9.04
# Autor: Sérgio Luiz Araújo Silva 
# site: http://vivaotux.blogspot.com 

# cabeçalho
INICIO=`date +%d-%m-%Y+%H:%M`


echo " Script de instalação"
echo " veja aqui o que deu certo e o que não deu na sua"
echo " instalação de programas e codecs"
echo " script iniciado: "
echo " $INICIO"

# como adicionar o repositório mediabuntu
# fonte: https://help.ubuntu.com/community/Medibuntu
sudo wget http://www.medibuntu.org/sources.list.d/`lsb_release -cs`.list --output-document=/etc/apt/sources.list.d/medibuntu.list; sudo apt-get -q update; sudo apt-get --yes -q --allow-unauthenticated install medibuntu-keyring; sudo apt-get -q update

apt-get install -y install non-free-codecs

# idiomas
echo "Adicionando idoma português e removendo o idioma inglês"
apt-get -y install language-pack-pt language-pack-pt-base language-support-pt language-pack-gnome-pt
apt-get -y remove language-pack-en language-pack-en-base language-pack-gnome-en language-pack-gnome-en-base

# ferramenta para idiomas
apt-get install -y freespeak

# prepara um cd com pacotes
aptitude -y install aptoncd

# renomear grupos de arquivos
apt-get install -y pyrenamer

# abre um console à partir do nautilus
aptitude -y install nautilus-open-terminal

# meu editor de textos
aptitude -y install vim-gnome vim-doc

# controla o consumo de banda
sudo apt-get -y install trickle
# sudo apt-get update && sudo trickle -s -d 20 apt-get -y --force-yes upgrade

# criado de cds de audio
apt-get install serpentine

# extrator de cds
apt-get install -y sound-juicer

# controla qual sistema operacional inicia por padrão
# apt-get install -y startupmanager

# modulo python para imagens
apt-get install -y python-imaging

# atualiza hardwares detectaveis
update-pciids;update-usbids

# nautilus-actions
# http://nacaolivre.org/2007/03/18/personalizando-o-gnome-parte-1-nautilus-actions/
apt-get install -y nautilus-actions
 
# sombras e efeitos sem compiz
apt-get install xcompmgr transset

# compactadores
apt-get install -y unace rar unrar zip unzip p7zip-full \
 p7zip-rar sharutils aish uudeview mpack lha arj cabextract \
 file-roller zoo

# ferramentas para remasterizar o ubuntu
apt-get install -y remastersys unetbootin unetbootin-translations

# ferramentas de rede
apt-get install -y ssh sshfs smbfs nmap \
nfs-common nfs-kernel-server

apt-get install -y build-essential subversion

# corretor ortografico
apt-get install -y aspell

# plugin flash
apt-get install -y flashplugin-nonfree flashplugin-installer

# pidgin msn
apt-get install -y pidgin msn-pecan

# fortunes - biscoito da sorte
apt-get install -y fortune-mod fortunes fortunes-br

# remasterizar a distro
apt-get install -y remastersys unetbootin unetbootin-translations

# fonte da logo do ubuntu
apt-get install -y ttf-ubuntu-title

# fontes não livres
apt-get install -y ttf-mscorefonts-installer

# codecs multimedia
apt-get install -y w32codecs
apt-get install -y mpeg2dec vorbis-tools id3v2 mpg321 mpg123 libflac++6 ffmpeg toolame libmp4v2-0
apt-get install -y id3tool lame lame-extras libjpeg-progs  flac faac faad sox toolame
apt-get install -y ffmpeg2theora libmpeg3-1  mpegdemux x264
apt-get install -y gstreamer0.10-ffmpeg gstreamer0.10-fluendo-mp3 gstreamer-tools
apt-get install -y gstreamer0.10-gnonlin gstreamer0.10-sdl
apt-get install -y gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse
apt-get install -y gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse
apt-get install -y totem-gstreamer
apt-get install -y libdvdcss2 libdvdnav4
apt-get install -y vlc vlc-nox vlc-plugin-sdl
apt-get install -y vlc-plugin-alsa
apt-get install -y mplayer mplayer-fonts mplayer-skins mencoder
apt-get install -y xine-ui gxine totem-xine
apt-get install -y totem-plugins totem-plugins-extra
apt-get install -y udftools
apt-get install -y cdrdao vcdimager mjpegtools vcdtools transcode movixmaker-2 normalize-audio
apt-get install -y mp3gain avidemux nautilus-script-audio-convert tagtool easytag assogiate
apt-get install -y totem-mozilla mozilla-mplayer xine-plugin gxineplugin mozilla-plugin-vlc
apt-get install -y libdvdread3
apt-get install -y k9copy

# captura e converão de vídeo
echo "   Instalando o xvidcap e ffmpeg"
apt-get -y install ffmpeg xvidcap

# relógios e calendários flutuando na tela
# aplicações >> acessórios >> screenlets
echo "   Instalando screenlets"
apt-get -y install screenlets

# java6
apt-get install -y sun-java6-bin sun-java6-fonts sun-java6-jre sun-java6-jdk sun-java6-plugin \
equivs ttf-sazanami-gothic ttf-sazanami-mincho

# tutorial de digitação klavaro
apt-get install -y klavaro

# desenho vetorial inkscape
apt-get install -y inkscape

# manipulação de fotos
aptitude -y install imagemagick

apt-get remove -y transmission transmission-common transmission-gtk
apt-get install -y deluge deluge-common deluge-core deluge-torrent deluge-torrent-common

# temas
apt-get install -y gtk2-engines-mythbuntu gnome-themes-extras
apt-get install -y gtk2-engines-mythbuntu gnome-themes-extras gtk2-engines-aurora murrine-themes
apt-get install -y gtk2-engines-nimbus

# esmerald theme
sudo wget http://mirrors.kernel.org/ubuntu/pool/universe/e/emerald-themes/emerald-themes_0.2.1-0ubuntu1_all.deb
sudo dpkg -i emerald-themes_0.2.1-0ubuntu1_all.deb


# particionador
apt-get install -y gparted ntfsprogs ntfs-config

# backup
apt-get install -y grsync

echo "  parando os consoles de 3 a 6"
sed -i '6,7s/^start/stop/g' /etc/event.d/tty[3-6]
sed -i '/shutdown/ s/^/#/g' /etc/event.d/control-alt-delete

# ícones no desktop
echo "   habilitando os ícones no desktop"
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults \
 --type bool --set "/apps/nautilus/desktop/computer_icon_visible" "true"

# gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults \
# --type bool --set "/apps/nautilus/desktop/network_icon_visible" "true"

gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults \
 --type bool --set "/apps/nautilus/desktop/home_icon_visible" "true"

gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults \
 --type bool --set "/apps/nautilus/desktop/trash_icon_visible" "true"

# página inicial do firefox
gconftool-2 --direct \
--config-source xml:readwrite:/etc/opt/gnome/gconf/gconf.xml.mandatory \
--type string --set /apps/firefox/general/homepage_url "www.google.com"

# control-alt-delete abrindo gnome-system-monitor
echo "ajustando o atalho para abrir o monitor do sistema"
gconftool-2 --direct \
--config-source xml:readwrite:/etc/opt/gnome/gconf/gconf.xml.mandatory \
-t str --set /apps/metacity/global_keybindings/run_command_9 "<Control><Alt>Delete"

gconftool-2 --direct \
--config-source xml:readwrite:/etc/opt/gnome/gconf/gconf.xml.mandatory \
-t str --set /apps/metacity/keybinding_commands/command_9 "gnome-system-monitor"

# ícone de atualizações automáticas
#gconftool -s --type bool /apps/update-notifier/auto_launch false
gconftool-2 --direct \
--config-source xml:readwrite:/etc/opt/gnome/gconf/gconf.xml.mandatory \
--type bool --set /apps/update-notifier/auto_launch "false"


# jogos
apt-get install -y frozen-bubble
apt-get install -y wormux

# suporte ao \LaTeX\
apt-get install -y texlive-generic-recommended
apt-get install -y texlive-latex-extra
apt-get install -y texlive-doc-base
apt-get install -y texlive-pstricks
apt-get install -y texlive-base-bin
apt-get install -y texlive-font-utils
apt-get install -y texlive
apt-get install -y texlive-lang-latin
apt-get install -y texlive-fonts-recommended
apt-get install -y texlive-bibtex-extra
apt-get install -y texlive-fonts-extra
apt-get install -y texlive-latex-recommended
apt-get install -y texlive-pictures
apt-get install -y preview-latex-style
apt-get install -y tetex-bin
apt-get install -y texlive-publishers
apt-get install -y texlive-latex-base
apt-get install -y tcl8.4
apt-get install -y texlive-lang-portuguese
apt-get install -y tetex-extra
apt-get install -y texlive-math-extra
apt-get install -y texlive-lang-other
apt-get install -y libpoppler2
apt-get install -y tex-common
apt-get install -y texlive-common
apt-get install -y pybliographer