Transform GNOME Shell to behave like Unity

You can make GNOME Shell 3.10 look and behave sort of like Unity (Ubuntu 14.04). It’s not difficult but requires you to gather things from a lot of places. This in turn means you have yo trust a lot of individuals or teams to have done their part well for the whole to function well.

Here’s a checklist of modifications you may need to make and how to do them in openSUSE 13.1.

GNOME Shell Extensions

You’ll want to install these GNOME Shell extensions.

AppKeys – Use Super+number to activate applications.

Alt Tab Workspace – Configure Alt+Tab to work only on the windows in the current desktop.

Dash to Dock – Show the dock you see in the overview screen (when you hit the Super key) on your desktop.

Font

To get fonts working better than they do out of the box in openSUSE you need to install Infinality. You’ll need to log out and log back in for it to start working for you.

You may also want to install the Ubuntu Fonts. I prefer it over other Monospace fonts, although DejaVu Sans Mono is a close second for me.

Terminal

You need to do two things: (1) use Ubuntu Mono font at size 13; (2) use #3D0029 as your background color (it’s dark aubergine).

I use this for my PS1.

PS1='\n\n\u @ \[33[01;32m\]\h\[33[00m\] \[33[01;34m\][\w]\[33[00m\] $ '

Tweak Tool

You should install Tweak Tool. It’ll help you to configure many things in GNOME Shell that you otherwise won’t be able to. I have used it to configure the system-wide fonts thusly.

  • Window Titles – Ubuntu Medium 11
  • Interface – Ubuntu Light 11
  • Documents – Ubuntu Light 11
  • Monospace – Ubuntu Mono 11
  • Hinting – None
  • Antialiasing – Grayscale
  • Scaling Factor – 1.0

Thanks, too, to these resources: Dark Aubergine, Comment on reddit by zman0900, How to quickly configure superb subpixel hinted smooth fonts for openSUSE 12.3.

Advertisements

pkgsrc on Linux – Quickstart Guide

A much more opinionated and updated guide is now on my new blog location. You should head over there instead.

Do you want to try out pkgsrc on Linux? Here’s a quickstart guide (tested on Ubuntu 14.04). Of course, always refer to the pkgsrc guide for accurate information.

Get pkgsrc

Install prerequisities.

user@host [~] $ sudo apt-get install build-essential libncurses-dev

Create directory structure in your home directory.

user@host [~] $ mkdir ~/opt

user@host [~] $ cd ~/opt

You have two options for getting pkgsrc: (1) the official ways: by downloading a tar file and extracting it, or by using CVS; (2) by using git. The first way, by using a tar file, is this:

Download pkgsrc and extract.

user@host [~/opt] $ curl -O http://ftp.netbsd.org/pub/pkgsrc/stable/pkgsrc.tar.gz

user@host [~/opt] $ tar xvzf pkgsrc.tar.gz

The second way, to use git, is also easy. Jörg Sonnenberger has created a GitHub repo that automatically syncs with pkgsrc source.

user@host [~/opt] $ git clone https://github.com/jsonn/pkgsrc.git

I think I would prefer using git.

Install and Setup pkgsrc

Install pkgsrc.

user@host [~/opt] $ cd ~/opt/pkgsrc/bootstrap/

user@host [~/opt/pkgsrc/bootstrap] $ export SH=/bin/bash

user@host [~/opt/pkgsrc/bootstrap] $ ./bootstrap --unprivileged

Post install steps.

user@host [~/opt/pkgsrc/bootstrap] $ cat >> ~/pkg/etc/security.local << EOF
    if [ -x $HOME/pkg/sbin/pkg_admin ]; then
            $HOME/pkg/sbin/pkg_admin audit
    fi
    EOF

user@host [~/opt/pkgsrc/bootstrap] $ echo "export PATH=\$PATH:\$HOME/pkg/bin:\$HOME/pkg/sbin" >> ~/.bashrc

user@host [~/opt/pkgsrc/bootstrap] $ source ~/.bashrc

user@host [~/opt/pkgsrc/bootstrap] $ pkg_admin -K ~/pkg/var/db/pkg fetch-pkg-vulnerabilities

user@host [~/opt/pkgsrc/bootstrap] $ echo 'alias pkgupvuln="\$HOME/pkg/sbin/pkg_admin -K ~/pkg/var/db/pkg fetch-pkg-vulnerabilities >/dev/null 2>&1"' >> ~/.bash_aliases

If you used git to get pkgsrc then move on to the next section.

If you did not use git to get pkgsrc then this is the best way going forward. Install CVS and update pkgsrc.

user@host [~/opt/pkgsrc/bootstrap] $ cd ~/opt/pkgsrc/devel/scmcvs/

user@host [~/opt/pkgsrc/devel/scmcvs] $ echo "export CVSEDITOR=vim" >> ~/.bashrc

user@host [~/opt/pkgsrc/devel/scmcvs] $ echo "export CVS_RSH=ssh" >> ~/.bashrc

user@host [~/opt/pkgsrc/devel/scmcvs] $ source ~/.bashrc

user@host [~/opt/pkgsrc/devel/scmcvs] $ bmake install clean clean-depends

user@host [~/opt/pkgsrc/devel/scmcvs] $ cd ~/opt/pkgsrc

user@host [~/opt/pkgsrc] $ cvs up -dP

user@host [~/opt/pkgsrc] $ cd ~/opt/pkgsrc/devel/scmcvs/

user@host [~/opt/pkgsrc/devel/scmcvs] $ bmake update

user@host [~/opt/pkgsrc/devel/scmcvs] $ bmake clean clean-depends

Install Package

Let’s install golang.

user@host [~/opt/pkgsrc] $ cd ~/opt/pkgsrc/lang/go

user@host [~/opt/pkgsrc/lang/go] $ bmake install clean clean-depends

Update Package

Follow these steps when you want to update a package, say golang.

user@host [~] $ pkg_admin -K ~/pkg/var/db/pkg fetch-pkg-vulnerabilities

user@host [~] $ cd ~/opt/pkgsrc

If you used git:
user@host [~/opt/pkgsrc] $ git pull

If you didn’t use git: user@host [~/opt/pkgsrc] $ cvs up -dP

user@host [~/opt/pkgsrc] $ cd ~/opt/pkgsrc/lang/go

user@host [~/opt/pkgsrc/lang/go] $ bmake update

user@host [~/opt/pkgsrc/lang/go] $ bmake clean clean-depends

Delete Package

You can uninstall a package and all its dependencies that are not needed by any other package.

user@host [~] $ pkg_delete -R go

Install Atom Editor in openSUSE

You’re better served if you read the official documentation: Linux build instructions. Then you should proceed with this post to get an idea of my experience installing Atom in openSUSE 13.1.

Install Prerequisites

Build stuff: sudo zypper install make gcc gcc-c++ glibc-devel libgnome-keyring-devel

node.js from Tumbleweed (to keep up with updates):

sudo zypper addrepo http://download.opensuse.org/repositories/devel:languages:nodejs/openSUSE_Tumbleweed/devel:languages:nodejs.repo

sudo zypper refresh

sudo zypper install nodejs

Configure npm to use Python 2: sudo npm config set python /usr/bin/python2 -g

Install git: sudo zypper install git

Get Source, Build, Install

mkdir ~/src && cd ~/src

Get the source: git clone https://github.com/atom/atom

cd ~/src/atom

For some reason you need to re-configure npm to use Python 2. Don’t ask why; it just worked for me and failed if I didn’t: sudo npm config set python /usr/bin/python2 -g

Build: script/build

Install: sudo script/grunt install

Create an atom.desktop file with the following contents: vim ~/.local/share/applications/atom.desktop

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Atom
Comment=Atom editor by GitHub
Exec=/usr/local/bin/atom
Icon=/home/cg/.atom/atom.png
Terminal=false

Copy the icon image file to be used in the atom.desktop file: cp ~/src/atom/resources/atom.png ~/.atom

Now you are ready to start using Atom.

Install Sublime Text in openSUSE

I’ve been trying out the Sublime Text 3 Beta on openSUSE and Mac OS X and I like it so far. There are a few bugs, as expected, but it’s a great editor.

Head over to Sublime Text 3 Beta and download the 64-bit tarball (or 32-bit if that’s your environment).

Untar the file: tar xvjf sublime_text_3_*.tar.bz2

Since I’m the only user on the machine and a local install was fine for me I didn’t install it to /opt. Instead, I installed it to ~/bin. This meant I had to customize the install steps a little bit.

mv sublime_text_3/ ~/bin/

You also want to be able to run Sublime using your desktop environment’s menus and such. Copy the .desktop file to your local directory, changing paths as needed.

sed -e 's!Exec=/opt/sublime_text/sublime_text!Exec=$HOME/bin/sublime_text_3/sublime_text!g' -e 's!Icon=sublime-text!Icon=$HOME/bin/sublime_text_3/Icon/256x256/sublime-text.png!g' sublime_text.desktop > ~/.local/share/applications/sublime_text.desktop

I tried this successfully with Sublime Text 3 build 3059 on openSUSE 13.1.

Run Wireshark in openSUSE as non-root user

There are two aspects of using Wireshark in openSUSE: capturing packets and displaying packets. To display packets or view pcap files you don’t need to run Wireshark as root. You also don’t need to do anything extra other than installing it. However, to capture packets you need root privileges. If you don’t have root privileges or want to capture packets as your regular user then you need a few extra steps.

Install Wireshark: sudo zypper install wireshark

Run Wireshark as non-root user to view captures

There is one caveat to running Wireshark in openSUSE as non-root user: when you run Wireshark from the GUI (say GNOME Shell) you are prompted to enter the root password. There’s a simple workaround to this by creating a local wireshark.desktop file, copied from /usr/share/applications/wireshark.desktop, with a slight modification.

cat /usr/share/applications/wireshark.desktop | sed -e 's!Exec=/usr/bin/xdg-su -c /usr/bin/wireshark %f!Exec=/usr/bin/wireshark %f!g' > /home/cguser/.local/share/applications/wireshark.desktop

In the command above we are creating a copy of /usr/share/applications/wireshark.desktop and saving it to /home/cguser/.local/share/applications/wireshark.desktop. The one change we make is to execute Wireshark as a regular user and not as root. You’ll have to do this for all non-root users who need to run Wireshark.

Now when you start Wireshark as a regular (non-root) user you’ll be able to display packets without providing root credentials.

Run Wireshark as non-root user to capture packets

This portion was taken from Sniffing with Wireshark as a Non-Root User. Read that page first before proceeding.

Install setcap to set the capabilities of /usr/bin/dumpcap: sudo zypper install libcap-progs

Create a new group wireshark to restrict users who can use Wireshark to capture packets: sudo groupadd wireshark

Add your user to the wireshark group to be able to capture packets: sudo usermod -a -G wireshark cguser

Change the group of dumpcap to wireshark: sudo chgrp wireshark /usr/bin/dumpcap

Change the permissions of dumpcap to only allow users in wireshark group to be able to run it: sudo chmod o-rwx /usr/bin/dumpcap

Set the capabilities required by dumpcap to run since its group is no longer root: sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap

View the capabilities of dumpcap to confirm they were set correctly: getcap /usr/bin/dumpcap

/usr/bin/dumpcap = cap_net_admin,cap_net_raw+eip

Logout and login again to finalize the addition of your user to the wireshark group.

Now when you start Wireshark as a regular (non-root) user you’ll be able to capture packets without providing root credentials.

Note: This was tested working in openSUSE 13.1.

Using Wireshark in Ubuntu

There are two aspects of using Wireshark in Ubuntu (or Debian for that matter): capturing packets and displaying packets. To display packets or view pcap files you don’t need to run Wireshark as root. You also don’t need to do anything extra other than installing it. However, to capture packets you need root privileges. If you don’t have root privileges or want to capture packets as your regular user then you need a few extra steps.

Install Wireshark: sudo apt-get install wireshark

Configure Wireshark to allow non-root users to capture packets: sudo dpkg-reconfigure wireshark-common

Add your user to the wireshark group to be able to capture packets: sudo usermod -a -G wireshark cguser

Logout and login again to finalize the addition to the group.

Now when you start Wireshark as a regular (non-root) user you’ll be able to capture and display packets.

Note: This was tested working in Ubuntu 14.04 LTS Trusty Tahr.

zypper: The following package updates will not be installed

I was trying to update my openSUSE 13.1 install and got this:

sudo zypper update

Loading repository data...
Reading installed packages...

The following 8 package updates will NOT be installed:
  libeXosip2-6 libgsm1 libortp9 libosip2 libspandsp2 libspeex1 libspeexdsp1 linphone 

Nothing to do.

I had linphone installed already but why would it not update? So I tried a distribution update (bad idea if you’re not actually upgrading your distribution to a newer release!):

sudo zypper dup

Warning: You are about to do a distribution upgrade with all enabled repositories. Make sure these repositories are compatible before you continue. See 'man zypper' for more information about this command.
Loading repository data...
Reading installed packages...
Computing distribution upgrade...

The following 42 NEW packages are going to be installed:
  bash-doc dconf desktop-translations exim gsettings-backend-dconf libdconf1 libproxy1-config-gnome3 libtidyp-1_04-0 openssh-askpass perl-Data-Dump perl-Encode-Locale perl-File-Listing perl-HTML-Parser 
  perl-HTML-Tagset perl-HTML-Tidy perl-HTTP-Cookies perl-HTTP-Daemon perl-HTTP-Date perl-HTTP-Message perl-HTTP-Negotiate perl-IO-HTML perl-IO-Socket-SSL perl-LWP-MediaTypes perl-LWP-Protocol-https 
  perl-Net-DBus perl-Net-HTTP perl-Net-LibIDN perl-Net-SSLeay perl-Text-Wrapper perl-Tie-IxHash perl-TimeDate perl-URI perl-WWW-RobotRules perl-X11-Protocol perl-XML-Twig perl-XML-XPathEngine 
  perl-libwww-perl readline-doc ucode-intel vim-data xdg-utils zypper-log 

The following 8 packages are going to be upgraded:
  libeXosip2-6 libgsm1 libortp9 libosip2 libspandsp2 libspeex1 libspeexdsp1 linphone 

The following 8 packages are going to change vendor:
  libeXosip2-6  openSUSE -> obs://build.opensuse.org/network:telephony
  libgsm1       openSUSE -> obs://build.opensuse.org/network:telephony
  libortp9      openSUSE -> obs://build.opensuse.org/network:telephony
  libosip2      openSUSE -> obs://build.opensuse.org/network:telephony
  libspandsp2   openSUSE -> obs://build.opensuse.org/network:telephony
  libspeex1     openSUSE -> obs://build.opensuse.org/network:telephony
  libspeexdsp1  openSUSE -> obs://build.opensuse.org/network:telephony
  linphone      openSUSE -> obs://build.opensuse.org/network:telephony


8 packages to upgrade, 42 new, 8  to change vendor.
Overall download size: 18.5 MiB. After the operation, additional 62.2 MiB will be used.
Continue? [y/n/? shows all options] (y): 

I did not proceed with a dist-upgrade. As you can see, the vendor was being changed from openSUSE to an OBS repository.

That’s when I realized(*) that not only was linphone provided by the openSUSE repos but also this OBS repo I was using for SIPp. So what’s the solution? I need this OBS repo but I don’t want to keep seeing this message (for semi-OCD reasons). I haven’t found a solution yet but at least I can rest easy knowing why I was seeing this message.

(*) OK, I found a pointer to the actual cause. Hat tip to Zypper: The following package updates will NOT be installed