Customize Ubuntu and Unity

This is mostly a checklist for myself, might end up as a script, who knows?

Applications & Indicators

Unity Tweak Tool

sudo apt-get install unity-tweak-tool

Compiz Settings Manager

sudo apt-get install compizconfig-settings-manager

System Load indicator

sudo apt-get install indicator-multiload

Search for “System Load Indicator” in dash to enable it.

Workspace indicator

sudo apt-get install python-wnck python-appindicator
cd ~/Downloads
wget "http://ppa.launchpad.net/geod/ppa-geod/ubuntu/pool/main/i/indicator-workspaces/indicator-workspaces_0.6.4_all.deb"
sudo dpkg -i indicator-workspaces_0.6.4_all.deb
indicator-workspaces & disown

Right click on the indicator, chose “Preferences” and check “Start indicator at login”.

Redshift

sudo apt-get install redshift-gtk

Unity Launcher

Flatten launcher icons

Remove icon “backdrop” in the Unity launcher, to get a cleaner look.

git clone https://github.com/mjsolidarios/unity-flatify-icons.git
cd unity-flatify-icons
sh unity-flatify-icons.sh

Remove animations and decorations

Start the settings manager by pressing Alt+F2 and entering about:config. Go to the “Launcher” tab and scroll down to the bottom. Set “Launcher Backlight Mode” to “Backlight Always Off” and “Launcher Icon Launch Animation” to “None”.

Theming

Arc Unity/GTK3 theme

wget http://download.opensuse.org/repositories/home:Horst3180/xUbuntu_15.04/Release.key
sudo apt-key add - < Release.key && rm -rf Release.key sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_15.10/ /' >> /etc/apt/sources.list.d/arc-theme.list"
sudo apt-get update
sudo apt-get install arc-theme

Emerald-dark icon theme

sudo add-apt-repository ppa:noobslab/icons 
sudo apt-get update
sudo apt-get install emerald-icons-theme

Source Code Pro font

cd ~/Downlods
wget "https://github.com/adobe-fonts/source-code-pro/archive/2.010R-ro/1.030R-it.zip"
mkdir -p ~/.local/share/fonts
cd ~/.local/share/fonts
unzip ~/Downloads/1.030R-it.zip
fc-cache -f

X11 cursor

Using Obsidian theme which is downloadable from gnome-look.org.

cd ~/Downloads
wget http://gnome-look.org/CONTENT/content-files/73135-Obsidian.tar.bz2
cd /usr/share/icons
sudo tar jxvf ~/Downlods/Obsidian.tar.bz2
sudo update-alternatives --install /usr/share/icons/default/index.theme x-cursor-theme /usr/share/icons/Obsidian/index.theme 20
sudo update-alternatvies --set x-cursor-theme /usr/share/icons/Obsidian/index.theme
gsettings set org.gnome.desktop.interface cursor-theme "Obsidian" 
sudo cat <<EOF >> /etc/X11/Xresources/x11-common
Xcursor.size: 24
Xcursor.theme: Obsidian
EOF

Miscellaneous

Disable the grid in lightdm

This disables the grid both at login and after locking the screen.

gsettings set com.canonical.unity-greeter draw-grid false
sudo xhost +SI:localuser:lightdm
sudo su lightdm -s /bin/bash
gsettings set com.canonical.unity-greeter draw-grid false

Terminology as terminal emulator

I was using E16 in the beginning of 21st century, waiting for E17 to come along…

The E17 project has some nice stuff going on, one of them being the terminal emulator (on steroids) Terminology.

How to install it, and make it the default alternative for x-terminal-emulator:

sudo add-apt-repository ppa:enlightenment-git/ppa
sudo apt-get update
sudo apt-get install terminology
sudo update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/bin/terminology 50
sudo dpkg-divert --local --rename --add /usr/bin/gnome-terminal
sudo ln -s /usr/bin/terminology /usr/bin/gnome-terminal

Read more here [ubuntuhandbook.org].

I haven’t found any way to change which terminal emulator is launched when right clicking on the desktop and choosing ‘Open Terminal’.

You can open System Settings, Keyboard, Shortcuts, Custom Shortcuts and add a new one binding it to ctrl + alt + t:

Name: Open Terminology
Command: terminology

Run production WordPress site in docker for development

I have a couple of WordPress sites that I wanted to create local development environments in docker for, here are some tips on how to get it to work.

I use the official MySQL and WordPress docker images. The directory structure is as follows:

dev-env.sh:

update-development-site.sh:

production_dump.sql is a MySQL dump of the production database, add a “use wordpress-site;” statement in the beginning so that the backup is imported into the correct database.

Installing Ubuntu on Dell XPS 13

Today I got my new Dell XPS 13. Being an Macbook user for the past 5-6 years, this was quite exciting for me; I finally got to run Linux on the desktop again!

So, I created the USB installation stick in Windows and booted to the Live system.

First “bump” was the Dell Wireless network interface that the laptop came with. It’s a Broadcom BCM4352 chip which has a properitary driver.

root@ubuntu:~# lspci -v | grep -i bcm
02:00.0 Network controller: Broadcom Corporation BCM4352 802.11ac Wireless Network Adapter (rev 03)

The required packages is included on the USB installation stick, so it’s just a matter of installing them (this would have to be repeated once booting into the freshly installed system):

sudo dpkg -i /cdrom/pool/main/d/dkms/dkms_2.2.0.3-2ubuntu3_all.deb
sudo dpkg -i /cdrom/pool/restricted/b/bcmwl/bcmwl-kernel-source_6.30.223.248+bdcom-0ubuntu2_amd64.deb

After the installation and restarting the laptop it couldn’t find any bootable devices(!). Reading the release notes, this is a known problem. The bug 1499323 has a workaround.

To enable palm detection, which should have a similar effect as above:

sudo apt-get install xserver-xorg-input-libinput

Then create /etc/X11/xorg.conf.d/99-libinput.conf:

Section "InputClass"
    Identifier "libinput"
    Driver "libinput"
    MatchDevicePath "/dev/input/event*"
    MatchIsTouchpad "true"
    Option "Tapping" "true"
    Option "TappingDragLock" "true"
    Option "ClickMethod" "none"
    Option "NaturalScrolling" "false"
EndSection

The above settings should make the touchpad behave “similar” to an Apple touchpad.

To improve battery life you can install TLP:

TLP brings you the benefits of advanced power management for Linux without the need to understand every technical detail. TLP comes with a default configuration already optimized for battery life, so you may just install and forget it. Nevertheless TLP is highly customizable to fulfil your specific requirements.

As of 15.10, tlp is part of the official repositories, if you’re running an earlier release:

sudo add-apt-repository ppa:linrunner/tlp

It is easy as:

sudo apt-get update
sudo apt-get install tlp tlp-rdw gsmartcontrol smart-notifier

Bluetooth does not work out-of-the box. To get it working, we need a firmware file from the Windows driver. Good guy hg8 has it available on github.com for us.

wget https://github.com/hg8/bluetooth-firmware-XPS13-9343/blob/master/BCM20702A0-0a5c-216f.hcd
sudo mv BCM20702A0-0a5c-216f.hcd /lib/firmware/brcm/
sudo ln -s /lib/firmware/brcm/BCM20702A0-0a5c-216f.hcd /lib/firmware/brcm/BCM20702A1-0a5c-216f.hcd

Change the bluetooth device name with:

sudo -i
echo "PRETTY_HOSTNAME=$HOSTNAME" > /etc/machine-name
systemctl restart bluetooth.service

Additional resources:

Building the Darwin Streaming Server in Ubuntu

Me and a colleague tried building the Darwin Streaming server on Ubuntu Server 13.10 with the help of this guide [instructables.com].

It did not go as well as we were hoping due to build errors. After some troubleshooting (all credit goes to my colleague), it turned out that the linking of libraries was not done recursively. So even though the correct libraries was included in LDFLAGS it wouldn’t work.

With the following two changes, we got rid of the build errors:

$ cd lstoll*
$ find . -name "Makefile.*" -exec sed -i 's/-lQTFileExternalLib/-lQTFileExternalLib -lpthread/' {} \;
$ sed -i 's/-lQTFileLib/-lQTFileLib -ldl/' Makefile.POSIX