Monday, 10 November 2014

Elementary OS Luna Configuration Script

Elementary OS 'Luna'  rocks!...... BUT, it does need some help out of the box.  Nothing crazy, mostly look & feel improvements, removing programs and adding others.  I'm in the middle of buying a new laptop, and am trying out lots of different installs.  To help save time (and sanity) I wrote a short script to configure Luna the way I want right after install.

Now, it's not perfect.... there may be a few hiccups but it basically turns this:

Pre config script
. . .into this:
Post config script!

I think it's a lot more polished look, so I'm sharing the script below to help my fellow elementary OS-ers.  

What it does

Uninstalls all these default applications:
  • Midori (default browser) 
  • Software Center (default software management)
  • Scratch (text editor) 
  • ModemManager (does anyone really need this?)
  • Empathy (chat aggregator)
  • Indicator-messages (empathy chat in the toolbar)
  • Maya (default calendar)
  • Geary  (mail app....because, really, nothing beats Gmail in the browser)
  • Shotwell (photos)
  • Totem (video player)
  • Noise (I was going to replace this with Clementine but turns out I like Noise better)
Installs these (better?) applications:
  • Google Chrome
  • Firefox
  • Zotero  (& Qnotero)
  • Dconf tools
  • Gedit (text editor)
  • Gnome Partition Manager
  •  VLC media player
  • Lots of unzip and file packaging utilities
  • Ubuntu Restricted Extras
  • Pinta (image editor... yeah, I like it better than the Gimp)
  • GPicView Image Viewer
  • Elementary Tweaks (this rocks!)
  • a bunch of Elementary Window, Icon & Plank themes
  • Super Wingpanel & Synapse search indicator
  • Skype
  • Libreoffice & dictionaries
  • QBitTorrent
  • Conky
Makes some settings & config changes:
  • Shortens window open/close animation time
  • Reduces window shadows but about 90%
  • Top-left hot corner shows all windows
  • Default "list" in pantheon-files (instead of icons) and default double-click (instead of single)
  • Change Plank icons (smaller) and apply HUD theme
  • Apply elFaenza icon set to everything
  • Configure Conky (a la custom elementary OS conky theme)
  • a few other gedit and terminal settings changes

Some cavetats

  • Some applications need 3rd party repositories.  These REPOSITORIES WILL BE ADDED TO YOUR APPROVED LIST
  • You might need to make some edits to your conky script to get it working properly
  • Super-Wingpanel and Conky might not work correctly until a reboot
  • Many settings can be modified and tweaked via Elementary Tweaks.  Access this from your Settings application menu.

Ok, ok, where's the script?

Download it here or copy the full text below:

### Written by anjp on 04-November-2014
### Download Elementary OS from here:
### Save this script as and run in Terminal "sudo sh"

###  Function list
    while true; do
        read -p "Are you sure? Run with NO USER INPUTS (y/n)???" yn
        case $yn in
            [Yy]* )
                    ### Remove the eOS Junk                  
                    read -p "First is removing eOS default apps.  Press ENTER key to continue..." pause
                    sudo apt-get autoremove --purge midori-granite software-center scratch-text-editor modemmanager empathy indicator-messages maya-calendar geary shotwell totem              
                    echo "Done removing eOS junk apps...\n"
                    ### Add all the new Repos
                    read -p "Next is adding new Repos.  Be patient.  Press ENTER key to continue..." pause
                    sudo add-apt-repository ppa:pinta-maintainers/pinta-stable
                    sudo apt-add-repository ppa:versable/elementary-update
                    sudo add-apt-repository ppa:smathot/cogscinl
                    sudo apt-add-repository "deb precise partner"
                    sudo add-apt-repository ppa:libreoffice/ppa
                    sudo add-apt-repository ppa:git-core/ppa
                    wget -q -O - | sudo apt-key add -
                    sudo sh -c 'echo "deb stable main" >> /etc/apt/sources.list.d/google-chrome.list'                  
                    wget \    -O /tmp/
                    chmod +x /tmp/                  
                    echo "Done adding Repos...\n"
                    ### Update
                    read -p "Next is an apt-get update.  Press ENTER key to continue..." pause
                    sudo apt-get update
                    echo "Done with update\n"
                    ### Install new software                                      
                    read -p "Next is installing all new software.  Press ENTER key to continue..." pause                  
                    sudo apt-get install google-chrome-stable firefox dconf-tools gedit gedit-plugins gparted vlc unace unrar zip unzip xz-utils p7zip-full p7zip-rar sharutils rar uudeview mpack arj cabextract file-roller ubuntu-restricted-extras pinta gpicview elementary-desktop elementary-tweaks elementary-blue-theme elementary-champagne-theme elementary-colors-theme elementary-dark-theme elementary-harvey-theme elementary-lion-theme elementary-milk-theme elementary-plastico-theme elementary-whit-e-theme elementary-elfaenza-icons elementary-emod-icons elementary-enumix-utouch-icons elementary-nitrux-icons elementary-taprevival-icons elementary-plank-themes super-wingpanel indicator-synapse qnotero skype libreoffice libreoffice-style-human libreoffice-style-oxygen libreoffice-style-crystal libreoffice-style-sifr libreoffice-style-tango libreoffice-style-galaxy libreoffice-pdfimport hyphen-en-us mythes-en-us libreoffice-help-en-us qbittorrent git conky lm-sensors
                    sudo /tmp/
                    sudo rm /tmp/
                    echo "Done installing new software...\n"                                      
                    ### Gala Configs - Window Animations
                    read -p "Next is shortening Window Animations.  Press ENTER key to continue..." pause                                      
                    gsettings set org.pantheon.desktop.gala.animations close-duration 260
                    gsettings set org.pantheon.desktop.gala.animations menu-duration 120
                    gsettings set org.pantheon.desktop.gala.animations minimize-duration 160
                    gsettings set org.pantheon.desktop.gala.animations close-duration 300
                    gsettings set org.pantheon.desktop.gala.animations snap-duration 120
                    gsettings set org.pantheon.desktop.gala.animations close-duration 300
                    echo "Done shortening Window Animations...\n"
                    ### Gala Configs - Change to Windows Min/Max/Close
                    read -p "Next is changing window min/max/close buttons.  Press ENTER key to continue..." pause                                      
                    gsettings set org.pantheon.desktop.gala.appearance button-layout ":minimize,maximize,close"
                    echo "Done changing window buttons...\n"
                    ### Gala Configs - Change Hot Corner Top-Left
                    read -p "Next is changing top left hot corner.  Press ENTER key to continue..." pause                                      
                    gsettings set org.pantheon.desktop.gala.behavior hotcorner-topleft "window-overview"
                    echo "Done changing window buttons...\n"
                    ### Gala Configs - Decreasing Window Shadows
                    read -p "Next is decreasing window shadows .  Press ENTER key to continue..." pause                                      
                    gsettings set org.pantheon.desktop.gala.shadows dialog-focused "['2','-1','0','1','190']"
                    gsettings set org.pantheon.desktop.gala.shadows dialog-unfocused "['2','-1','0','1','130']"
                    gsettings set org.pantheon.desktop.gala.shadows menu "['2','-1','0','1','130']"
                    gsettings set org.pantheon.desktop.gala.shadows normal-focused "['3','-1','0','2','220']"
                    gsettings set org.pantheon.desktop.gala.shadows normal-unfocused "['2','-1','0','2','150']"
                    echo "Done decreasing window shadows...\n"
                    ### Gala Configs - Files LIST VIEW and DOUBLE CLICK
                    read -p "Next is changing Files List View and Double Click.  Press ENTER key to continue..." pause                                      
                    gsettings set org.pantheon.files.preferences default-viewmode "list"
                    gsettings set org.pantheon.files.preferences single-click false
                    echo "Done Gala Files configs ...\n"
                    ### Gedit Configs
                    read -p "Next are gedit formatting configs.  Press ENTER key to continue..." pause                                      
                    gsettings set org.gnome.gedit.preferences.editor auto-indent true
                    gsettings set org.gnome.gedit.preferences.editor display-line-numbers true
                    gsettings set org.gnome.gedit.preferences.editor display-right-margin true
                    gsettings set org.gnome.gedit.preferences.editor wrap-mode none                
                    echo "Done gedit configs...\n"
                    ### Terminal Configs
                    read -p "Next is changing terminal forget tabs upon reload.  Press ENTER key to continue..." pause                                      
                    gsettings set org.pantheon.terminal.settings remember-tabs false                  
                    echo "Done terminal configs...\n"
                    ### Super Wingpanel Configs
                    read -p "Next Super Wingpanel configs.  Press ENTER key to continue..." pause                                      
                    gsettings set org.pantheon.desktop.super-wingpanel enable-slim-mode true
                    gsettings set org.pantheon.desktop.super-wingpanel hide-mode "Intellihide"
                    gsettings set org.pantheon.desktop.super-wingpanel slim-panel-edge "Curved 3"
                    gsettings set org.pantheon.desktop.super-wingpanel slim-panel-separate-launcher true
                    gsettings set org.pantheon.desktop.super-wingpanel slim-panel-margin 64
                    gsettings set org.pantheon.cerbere monitored-processes "['super-wingpanel', 'plank', 'slingshot-launcher --silent']"
                    killall wingpanel & super-wingpanel &        
                    echo "Done super-wingpanel configs...\n"
                    ### Plank
                    read -p "Next is configuring Plank.  Press ENTER key to continue..." pause
                    rm ~/.config/plank/dock1/settings
                    rm ~/.config/plank/dock1/launchers/*                                  
   echo "#This file auto-generated by Plank.

#Whether to show only windows of the current workspace.
#The size of dock icons (in pixels).
#If 0, the dock won't hide.  If 1, the dock intelligently hides.  If 2, the dock auto-hides. If 3, the dock elementary-hides.
#Time (in ms) to wait before unhiding the dock.
#The monitor number for the dock. Use -1 to keep on the primary monitor.
#List of *.dockitem files on this dock. DO NOT MODIFY
#The position for the dock on the monitor.
#The dock's position offset from center (in percent).
#The name of the dock's theme to use.
#The alignment for the dock on the monitor's edge.
#The alignment of the items in this dock.
ItemsAlignment=3" > ~/.config/plank/dock1/settings

echo "[PlankItemsDockItemPreferences]
Launcher=file:///usr/share/applications/google-chrome-stable.desktop" > ~/.config/plank/dock1/launchers/google-chrome-stable.dockitem

echo "[PlankItemsDockItemPreferences]
Launcher=file:///usr/share/applications/firefox.desktop" > ~/.config/plank/dock1/launchers/firefox.dockitem

echo "[PlankItemsDockItemPreferences]
Launcher=file:///usr/share/applications/zotero.desktop" > ~/.config/plank/dock1/launchers/zotero.dockitem

echo "[PlankItemsDockItemPreferences]
Launcher=file:///usr/share/applications/libreoffice-startcenter.desktop" > ~/.config/plank/dock1/launchers/libreoffice-startcenter.dockitem

echo "[PlankItemsDockItemPreferences]
Launcher=file:///usr/share/applications/pantheon-files.desktop" > ~/.config/plank/dock1/launchers/pantheon-files.dockitem

echo "[PlankItemsDockItemPreferences]
Launcher=file:///usr/share/applications/switchboard.desktop" > ~/.config/plank/dock1/launchers/switchboard.dockitem

echo "[PlankItemsDockItemPreferences]
Launcher=file:///usr/share/applications/pantheon-terminal.desktop" > ~/.config/plank/dock1/launchers/pantheon-terminal.dockitem

echo "[PlankItemsDockItemPreferences]
Launcher=file:///usr/share/applications/gnome-screenshot.desktop" > ~/.config/plank/dock1/launchers/gnome-screenshot.dockitem
                    echo "Done Plank configs...\n"
                    ### Conky
                    read -p "Next is configuring Conky.  Press ENTER key to continue..." pause                                      
                    mv  ~/Downloads/.conkyrc ~/
                    mkdir ~/.fonts/
                    mv ~/Downloads/Dotmatrx.ttf ~/.fonts/
                    mv ~/Downloads/PIZZADUDEBULLETS.ttf ~/.fonts/
                    mv ~/Downloads/STYLBCC_.TTF ~/.fonts/
                    mv ~/Downloads/openlogos.ttf ~/.fonts/
                    mv ~/Downloads/weather.ttf ~/.fonts/
                    conky &
                    echo "Done ...\n"
                    read -p "Next is telling Conky to autostart.  Press ENTER key to continue..." pause                                      
                    mkdir ~/.config/autostart
echo > "[Desktop Entry]
Exec=conky -p 5
Name[en_CA]=Conky Launcher
Comment=Conky!" > ~/.config/autostart/Conky
                    echo "Done ...\n"

                    # Change start menu to open with ONLY the Super key, instead of Super + Space
                    # gsettings set org.gnome.desktop.wm.keybindings panel-main-menu "['Super_L','F2']"
                    ### next line to change back ###
                    # gsettings set org.gnome.desktop.wm.keybindings panel-main-menu "['space', 'F2']"

                    sudo apt-get update
                    sudo apt-get upgrade
                    sudo apt-get autoremove
                    sudo apt-get autoclean
                    #All done
                    echo "\nNO USER INPUT script complete!\n"                  
                    read -p "Press ENTER key to exit..." pause            
            [Nn]* ) break;;
            * ) echo "Please answer yes or no.";;

echo "\n******************************************************"
echo "***********  eOS Luna configuration script  **********"
echo "******************************************************\n"
echo "This script will remove most of the eOS default applications and install more commonly used ones\n"
echo "See '' for more info"
echo "Press CTRL + C at any time to exit...\n"
read -p "Press ENTER key to start..." pause

#### Option to just do everything without step-by-step
while true; do
    read -p "Do you just want to run the entire script WITH NO USER INPUTS (y/n)?" yn
    case $yn in
        [Yy]* )
        [Nn]* ) break;;
        * ) echo "Please answer yes or no.";;

### Starting user-input script
echo "\nStarting script with user input...\n"
echo "\n  Sorry, I got lazy and decided only to write the NO USER INPUT part!"
read -p "Press ENTER key to exit..." pause

Now just run the script in a terminal and follow the prompts:
sudo sh

I'm sure there will be some hiccups... post questions below and let me know what you did with all your time savings!


EruGaba said...

Hi there. I'd like to configure your script since there are default stuff i don't want to get rid of. and ignore installation of most new things since i've already installed them on my elementary. I'm not sure how to do it properly without messing something up. Would you lighten me up on how to do it? thanks in advance.

  © Blogger template 'Isolation' by 2008

Back to TOP