Justin's Code Haus
Ramblings of a compiler engineer

Category: General

i3 WM: Default Workspace Settings

I've been playing around with the i3 window manager a lot lately, and I have to say I enjoy it very much! But one default setting that tripped me up (as set by i3-config-wizard) was the key bindings for workspace switching:

bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
# ...

This works well until you start naming your workspaces. With these bindings, you will switch to workspace name "1", not number "1". So if you rename workspace 1 to "1: Firefox" and press Mod5+1, you'll end up opening a new workspace instead of going to the "1: Firefox" workspace. Not very intuitive! Luckily, we can easily get the desired behavior with a slight tweak to the config file:

bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
# ...

Posted Thu 11 July 2013 by Justin Holewinski in General (Linux, i3)

2012 and still no multi-monitor lovin'...

For the past week, I've been giving Windows 8 a serious try.  I've dabbled with the various preview versions, but now it's time to try the released version.  I've read the reviews, saw the mixed reactions to the new "Modern UI", and decided to see for myself how I feel about it. Generally speaking, I don't mind the new interface.  My usual method of launching a program was pressing the Win key, typing the first few letters of the application name, and then hitting Enter.  Still works in the Start Screen.  Start Menu vs. Start Screen, it doesn't bother me.  Except for one little detail...

... the complete lack of multi-monitor support in the Modern UI!

Simply put, there can only be one full-screen Modern UI app displayed at a time.  So if I open, say, Mail on one screen and attempt to open Maps on another screen, the screen showing Mail will go back to the desktop.  To make matters worse, the Start Screen counts as a Modern UI app in this regard.  If I have Mail open on one screen and try to open the Start Screen on another screen to launch an application, the screen showing Mail goes back to the desktop and I have to alt+tab back to it.  Talk about a disruption in my workflow!

Did I mention my main desktop is triple-head?  It comes in handy for coding.  All of the Windows 8 reviews I read talk about the pros and cons of the new Modern UI, but I rarely see any reference to the complete lack of multi-monitor support in it.  I'm not sure if this is just a feature oversight, or a more fundamental limitation in the model used for WinRT apps.   Is there a fundamental technical limitation in the operating system that prevents multiple Modern UI apps to be visible at the same time? If the Modern UI is the future, I sure hope they get this fixed ASAP!  For now, it's easy enough to just avoid Modern UI apps altogether, but what happens in the future when I find an app I want to keep open on one of my screens?

Perhaps more disturbing, this is becoming a trend in mainstream operating systems.  While Windows 8 has this limitation for Modern UI apps, full-screen apps in Mac OS X are not really any better.  If I full-screen an application in a multi-monitor configuration, I get that app on one monitor and a pretty background on all others.  I would much rather have the ability to put multiple apps in full-screen mode side-by-side, or perhaps have the option to have a full-screen app next to a desktop workspace on another monitor.  At least I can have multiple workspaces, though.

Perhaps I'm just too adjusted to my Linux multi-monitor configurations...

Posted Tue 06 November 2012 by Justin Holewinski in General (Windows, Desktop)

Installing Matplotlib on OS X 10.7 with Homebrew

[edit: It looks like things have changed a bit since the release of 10.7, so your mileage may vary with this method.  This was written when 10.7 was brand new and most software was not yet updated for it.]

For those of you that do not know, Matplotlib is an excellent Python plotting library that allows you to create professional-quality plots for inclusion on web pages, Latex documents, Beamer presentations, Keynote presentations, and any other software that can import SVG, EPS, PNG, or virtually any graphic format.

However, getting matplotlib installed on Mac OS X 10.7 can be a bit tricky, especially if you are using Homebrew as your "package manager."  First off, Homebrew does not have packages for matplotlib, as well as some of its dependencies.  Additionally, the current Matplotlib release version (1.0.1 as of this post) does not compile out-of-the-box against libpng 1.5, which is included in the X11 distribution shipped with Mac OS X 10.7.

For previous versions of Mac OS X (10.6, 10.5), the usual way to install matplotlib was to install python, pkg-config, and gfortran with Homebrew, then install numpy and matplotlib through pip, ala:

$ brew install python
$ brew install gfortran
$ brew install pkg-config
$ easy_install pip
$ pip install numpy
$ pip install matplotlib

Unfortunately, as previously mentioned, all is not so easy in the world of Mac OS X 10.7, and the difficulty lies with libpng 1.5, installed with Mac OS X 10.7's version of X11. Briefly put, Matplotlib 1.0.1 is not compatible with libpng 1.5 due to a change in the API. Fortunately, the fix is already applied up-stream and will probably be a part of Matplotlib 1.0.2, or 1.1.0, or whatever the next released version is.

Until the next release, the Matplotlib sources in Git can be used. Instead of pulling the sources from the Matplotlib SourceForge site, you need to pull them from the Matplotlib GitHub site. I'm not sure if this GitHub site is "official," but is looks to be.

All that is needed is to build Matplotlib from source instead of using pip, so the installation procedure is now:

$ brew install python
$ brew install gfortran
$ brew install pkg-config
$ easy_install pip
$ pip install numpy
$ cd $HOME
$ git clone https://github.com/matplotlib/matplotlib.git
$ cd matplotlib
$ python setup.py build
$ python setup.py install

And now you're good to go! Hopefully this will become much easier with the next official release of Matplotlib.

Posted Thu 21 July 2011 by Justin Holewinski in General (Homebrew, Mac OS X, Matplotlib)