script for changing gnome-terminal color schemes.

This is the Gnome-Logo made with vectors. GNOM...
This is the Gnome-Logo made with vectors. GNOME and the foot logo are trademarks of the GNOME Foundation. Español: Éste es el logo de Gnome hecho con vectores. GNOME y el logo del pie son marcas registradas de la Fundación GNOME (Photo credit: Wikipedia)

Earlier I had posted this. So, if you want to try all of these schemes, then you need not have to copy paste the schemes from the web page, you can try the below script.

#

function idleToes()
{
gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#FFFFFF"
gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#323232"
gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#FFFFA9"
gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#323232:#D25252:#7FE173:#FFC66D:#4098FF:#F57FFF:#BED6FF:#EEEEEC:#535353:#F070
70:#9DFF90:#FFE48B:#5EB7F7:#FF9DFF:#DCF4FF:#FFFFFF"
}

function Homebrew()
{
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#00FF00"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#000000"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#00FF00"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#000000:#990000:#00A600:#999900:#0000B2:#B200B2:#00A6B2:#BFBFBF:#666666:#
E50000:#00D900:#E5E500:#0000FF:#E500E5:#00E5E5:#E5E5E5"
}

function Kibble()
{
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#F7F7F7"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#0E100A"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#CA631D"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#4D4D4D:#C70031:#29CF13:#D8E30E:#3449D1:#8400FF:#0798AB:#E2D1E3:#5A5A5A:#
F01578:#6CE05C:#F3F79E:#97A4F7:#C495F0:#68F2E0:#FFFFFF"
}

function SolarizedDark()
{
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#708183"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#001E26"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#81908F"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#002731:#D01B24:#728905:#A57705:#2075C7:#C61B6E:#259185:#E9E2CB:#001E26:#
BD3612:#465A61:#52676F:#708183:#5856B9:#81908F:#FCF4DC"
}

function Grass()
{
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#FFF0A5"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#13773C"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#FFB03B"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#000000:#BB0000:#00BB00:#E7B000:#0000A3:#950061:#00BBBB:#BBBBBB:#555555:#
BB0000:#00BB00:#E7B000:#0000BB:#FF55FF:#55FFFF:#FFFFFF"
}

function Desert()
{
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#FFFFFF"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#333333"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#FFD700"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#4D4D4D:#FF2B2B:#98FB98:#F0E68C:#CD853F:#FFDEAD:#FFA0A0:#F5DEB3:#555555:#
FF5555:#55FF55:#FFFF55:#87CEFF:#FF55FF:#FFD700:#FFFFFF"
}

function ManPage()
{
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#000000"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#FEF49C"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#000000"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#000000:#CC0000:#00A600:#999900:#0000B2:#B200B2:#00A6B2:#CCCCCC:#666666:#
E50000:#00D900:#E5E500:#0000FF:#E500E5:#00E5E5:#E5E5E5"
}

function SolarizedLight()
{
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#52676F"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#FCF4DC"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#465A61"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#002731:#D01B24:#728905:#A57705:#2075C7:#C61B6E:#259185:#E9E2CB:#001E26:#
BD3612:#465A61:#52676F:#708183:#5856B9:#81908F:#FCF4DC"
}

function DarkPastel()
{
gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#FFFFFF"
gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#000000"
gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#FF5E7D"
gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#000000:#FF5555:#55FF55:#FFFF55:#5555FF:#FF55FF:#55FFFF:#BBBBBB:#555555:#FF55
55:#55FF55:#FFFF55:#5555FF:#FF55FF:#55FFFF:#FFFFFF"
}

function RedSands()
{
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#D7C9A7"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#79241E"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#DFBD22"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#000000:#FF3F00:#00BB00:#E7B000:#0071FF:#BB00BB:#00BBBB:#BBBBBB:#555555:#
BB0000:#00BB00:#E7B000:#0071AE:#FF55FF:#55FFFF:#FFFFFF"
}

function Twilight()
{
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#FEFFD3"
gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#141414"
gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#FEFFD3"
gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#141414:#C06C43:#AFB979:#C2A86C:#444649:#B4BE7B:#778284:#FEFFD3:#262626:#DD7C
4C:#CBD88C:#E1C47D:#5A5D61:#D0DB8E:#8A989A:#FEFFD3"
}

function Ocean()
{
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#FFFFFF"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#224FBC"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#FFFFFF"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#000000:#990000:#00A600:#999900:#0000B2:#B200B2:#00A6B2:#BFBFBF:#666666:#
E50000:#00D900:#E5E500:#0000FF:#E500E5:#00E5E5:#E5E5E5"
}

function Novel()
{
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#3B2322"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#DFDBC3"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#8E2A19"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#000000:#CC0000:#009600:#D06B00:#0000CC:#CC00CC:#0087CC:#CCCCCC:#7F7F7F:#
CC0000:#009600:#D06B00:#0000CC:#CC00CC:#0086CB:#FFFFFF"

}

function Zenburn()
{
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#DCDCCC"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#1F1F1F"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#FFCFAF"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#000B13:#E89393:#9ECE9E:#F0DFAF:#8CD0D3:#C0BED1:#DFAF8F:#EFEFEF:#000B13:#
E89393:#9ECE9E:#F0DFAF:#8CD0D3:#C0BED1:#DFAF8F:#FFFFFF"
}

function TerminalBasic()
{
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#000000"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#FFFFFF"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#000000"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#000000:#990000:#00A600:#999900:#0000B2:#B200B2:#00A6B2:#BFBFBF:#666666:#
E50000:#00D900:#E5E500:#0000FF:#E500E5:#00E5E5:#E5E5E5"

}

function Pro()
{
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#F2F2F2"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#000000"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#FFFFFF"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#000000:#990000:#00A600:#999900:#1F08DB:#B200B2:#00A6B2:#BFBFBF:#666666:#
E50000:#00D900:#E5E500:#0000FF:#E500E5:#00E5E5:#E5E5E5"

}

function Vaughn()
{
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#DCDCCC"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#25234E"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#FF5E7D"
    gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#24234F:#705050:#60B48A:#DFAF8F:#5555FF:#F08CC3:#8CD0D3:#709080:#709080:#
DCA3A3:#60B48A:#F0DFAF:#5555FF:#EC93D3:#93E0E3:#FFFFFF"
}

names=$(grep "^function" $0|sed -e 's/.* //' -e 's/(.*//')
echo "Select one of ${names[@]}"
read -p "Enter :: " name
$name

To use, simply copy/paste the script and chmod +x.

Run the script, it will present you with a list of schemes, just select and you are done 🙂

Enhanced by Zemanta

Ubuntu setup – post installation script

My iPhone apps as of February 2010
My iPhone apps as of February 2010 (Photo credit: dougbelshaw)

If you have done a new installation of Ubuntu or Fedora, then yuou know you have to search all kind of blogs to find out what all to install. So, here is a easier way to do that. Just run this script, it will install some applications which are mostly a “MUST” for all the installations. And the list of applications that are installed are :

colorgcc vim-gnome vim-gtk vlc evolution-exchange vlc smplayer mplayer
w32codecs skype wireshark patch openssh-server tkcvs g++ g++-multilib
libaio1 libpq5 libqscintilla2-8 libfam0 libqt3-mt libc6-dev
ubuntu-restricted-addons ubuntu-restricted-extras and
mediubutu repository.

And here is the script::

#!/bin/bash -
#===============================================================================
#
#          FILE:  ubuntu.sh
#
#         USAGE:  ./ubuntu.sh
#
#   DESCRIPTION:  Ububntu Post-Installation script.
#
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR: Amit Agarwal (aka)
#       CREATED: 26/06/12 13:13:21 IST
# Last modified: Fri Jun 29, 2012  04:54PM
#      REVISION:  ---
#===============================================================================

apps=(""  colorgcc vim-gnome vim-gtk  vlc evolution-exchange vlc smplayer mplayer w32codecs  skype wireshark patch openssh-server tkcvs g++ g++-multilib libaio1 libpq5 libqscintilla2-8 libfam0 libqt3-mt libc6-dev )
apps_desc=("" 
    "Colorgcc displays nice colrs for all the errors in compilation" 
    "Vim for Gnome" 
    "Required for Vim"
    "VLC Media Player"
    "Exchange plugin for Evolution"
    "GUI for mplayer"
    "Codecs to play all video/audio files"
    "skype :)"
    "Wireshark(a.k.a formely Ethereal)"
    "Utility to apply cvs diff or diff output to directory as patch"
    "SSH Server(not required for clients)"
    "GUI For CVS"
    "Dev Tool - C++ compiler"
    "Dev Tool to get the correct libraries" 
    "lib required for building applicatons" 
    "lib required for building applications" 
    "lib required for building applications" 
    "lib required for building applications" 
    "lib required for building applications" 
    "lib required for building applications" 
    "lib required for building applications" 
    "lib required for building applications"  )

echo '
Created by Amit Agarwal
'

if [[ $UID -ne 0 ]]
then
    echo "run with root user"
    exit
fi

if [[ ! -f /etc/sudoers.d/users ]]
then
    read -p "Please enter usernames to allow seperated by comma and no space allowed :: " a
    if [[ $a != "" ]]
    then

        echo "#Added by Amit Agarwal" >>/etc/sudoers.d/users
        for i in ${a//,/ /}
        do
            echo "$i ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers.d/users
        done
        chmod 0440 /etc/sudoers.d/users
    else
        echo "No entries added to sudoers"
    fi
else
    echo "Changes for sudo are already present"
    echo "List of users allowed without password in the sudoers file is ::"
    cat /etc/sudoers.d/users|awk '$1!="#.*"{print $1}'
    echo
fi

if [[ ! -f /etc/apt/sources.list.d/medibuntu.list ]]
then
    echo "Add the medibuntu repo.."
    wget http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list --output-document=/etc/apt/sources.list.d/medibuntu.list
    apt-get --yes -q --allow-unauthenticated install medibuntu-keyring
    echo "Update the apt with 'apt-get update' if you do not install anything."
else
    echo "Mediubuntu repo is already present"
fi

echo "Updating apt-get cache, wait for some time....."

i=1
while [[ $i -lt ${#apps[*]} ]]
do
    printf "%10s %3d. %-30s %-30sn" "" $i "${apps[$i]}" "${apps_desc[$i]}"
    ((i++))
done
echo "Please make your selection (enter the number)"
echo "(enter one at a time and end with blank line) ::"
read -p "Do you want to install all [y/N] ::" yesno
if [[ $yesno != "y" || $yesno != "Y" ]]
then
    readval=" "
    while [[ $readval != "" ]]
    do
        read -p "Enter the value :: " readval
        if [[ $(echo $readval|grep -c "[^0-9]") -ge 1 ]]
        then
            echo "Value is not acceptable, retry."
            readval=""
        else
            #echo "Selected now :: ${apps[$readval]}"
            appsinstall="$appsinstall ${apps[$readval]}"
            #echo "Selected so far $appsinstall"
        fi
    done
else
    appsinstall="${apps[*]}"
    echo "Selected apps are $appsinstall"
fi

apt-get -y install ubuntu-restricted-addons ubuntu-restricted-extras
if [[ ${#appsinstall} -ge 3 ]]
then
    echo "Apps selected to be udpated are $appsinstall"
    echo "Now updating apt-get cache"
    apt-get update -q >/dev/null
    apt-get -y --allow-unauthenticated install $appsinstall
fi
if [[ $? -ne 0 ]]
then
    echo "Something went wrong :("
    exit -1
fi

if [[ $appsinstall == *colorgcc* ]]
then
    echo "To use colorgcc, create a link with 'ln -s $(which colorgcc) g++'"
    echo "in ~/bin directory and add ~/bin to your PATH"
fi
Enhanced by Zemanta

Set gnome-shell to start in fallback mode without GUI.

If you run into issues with gnome-shell then gnome-shell should allow you to disable all the plugins and get the gnome-shell. But since gnome-shell is still evolving, you might run into issue where the shell does not come up. What to do in that case. You can set the shell to start in fallback mode, where there are more chances that it will come up.

Alas, but you don’t have a shell or desktop session to do that. Simple, start the gnome-shell and before it is killed, do this:

gsettings set org.gnome.desktop.session session-name 'gnome-fallback'

And to do this from one of the virtual terminals, you would need the terminal to be able to attach to the running session. You can get the script to do that from the gnome website in How to debug gnome-shell or copy the script below:

gnome_session=$(pgrep -u $USER gnome-session)
eval export $(sed 's/\o000/\n/g;' < /proc/$gnome_session/environ | grep DISPLAY)
eval export $(sed 's/\o000/\n/g;' < /proc/$gnome_session/environ | grep XAUTHORITY)
eval export $(sed 's/\o000/\n/g;' < /proc/$gnome_session/environ | grep DBUS_SESSION_BUS_ADDRESS)
Enhanced by Zemanta