MathJax

SyntaxHighlighter

Highlight

Custom CSS

Wednesday, December 21, 2011

Goodbye wmii. Hello i3!

A colleague recently recommend i3 to me, and I thought it was a rather good idea considering the problems I've been having with wmii (weirdly complicated configuration syntax, and problems with AWT).

wmii


(Notice the dialog box is not rendered correctly on the bottom right)

i3



The Swing problems are fixed in the HEAD of wmii's development branch, but I didn't notice that before I already committed to i3 (which is quite similar to wmii, but is less complicated to configure).

In the Debian/Ubuntu repositories, the latest version of i3 is 3.e (I think), but due to the configuration changes between 3 and 4, there may be some confusion about how to set up a status bar. The way to do it is to use i3status with the bar configuration directive with a 4.x+ release. You'll have to grab both i3wm and i3status from their respective repos and build the packages yourself. On Squeeze, apply this patch to i3 version 4.1 to make sure it builds correctly:

diff -rupN a/debian/control b/debian/control
--- a/debian/control    2011-11-11 14:40:38.000000000 -0800
+++ b/debian/control    2012-03-12 17:26:12.809273870 -0700
@@ -3,7 +3,7 @@ Section: utils
 Priority: extra
 Maintainer: Michael Stapelberg <michael@stapelberg.de>
 DM-Upload-Allowed: yes   
-Build-Depends: debhelper (>= 7.0.50~), libx11-dev, libxcb-util0-dev (>= 0.3.8), libxcb-ke
ysyms1-dev, libxcb-xinerama0-dev (>= 1.1), libxcb-randr0-dev, libxcb-icccm4-dev, libxcurso
r-dev, asciidoc (>= 8.4.4), xmlto, docbook-xml, pkg-config, libev-dev, flex, bison, libyaj
l-dev, texlive-latex-base, texlive-latex-recommended, texlive-latex-extra, libpcre3-dev, l
ibstartup-notification0-dev (>= 0.10)
+Build-Depends: debhelper (>= 7.0.50~), libx11-dev, libxcb-aux0-dev, libxcb-atom1-dev, lib
xcb-keysyms1-dev, libxcb-xinerama0-dev (>= 1.1), libxcb-randr0-dev, libxcb-icccm1-dev, lib
xcursor-dev, asciidoc (>= 8.4.4), xmlto, docbook-xml, pkg-config, libev-dev, flex, bison,
libyajl-dev, texlive-latex-base, texlive-latex-recommended, texlive-latex-extra, libpcre3-
dev, libstartup-notification0-dev (>= 0.10)
 Standards-Version: 3.9.2
 Homepage: http://i3wm.org/

You can apply this patch and build with:

cd i3-4.1
patch -p0 < /path/to/i3.patch
dpkg-buildpackage -uc -us

One other thing to note is that the i3status bar will not display correctly if there any errors; you also won't get any notification of errors if the font you specify is not correct (or missing).

Here is the result of switching to i3:


You can find my i3 configuration here.

Sunday, September 18, 2011

Ditz bash completion

I just had an "Oh, so that's how you do it" moment. The boss likes ditz for issue management; but for a while, I've been agonizing about how to do bash completion in ditz. The answer is you have to source this file: /var/lib/gems/1.8/gems/ditz-0.5/contrib/completion/ditz.bash. Oh, so that's how you do it!

Thursday, July 28, 2011

Getting my Logitech headset to work in Debian

I'm on Debian Squeeze at work, and I don't have any external speakers, but I do want to use a USB headset for pair programming and meetings and such. Getting the headset to work with Skype actually pretty easy; you just do some clicky click GUI monkey business and you're set. But having sound play for Youtube and other video sites (you know, stuff to do when NOT in meeting or pair programming), is trickier than I thought.

Here's what I did. First figure out which number the headset is:

$ cat /proc/asound/cards
 0 [Headset        ]: USB-Audio - Logitech USB Headset
                      Logitech Logitech USB Headset at usb-0000:00:1d.1-1, full speed
 1 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xfebdc000 irq 16
 2 [HDMI           ]: HDA-Intel - HDA ATI HDMI
                      HDA ATI HDMI at 0xfe9ec000 irq 17

Okay, so it's index 0. Then I made a new file called /etc/modprobe.d/sound and jammed this text in it:

options snd-usb-audio index=0

And then bingo bango bongo, there is sound in my Youtubes.

Sunday, May 8, 2011

Using adb to copy files from your android device over wireless

Actually, I don't know why this is so hard. I poked around in various forums and the android docs to deduce this process:

  1. Install android SDK.
  2. Run tools/android and install the platform tools.
  3. The adb tool will be under platform-tools/adb.
  4. Run the following as root: adb kill-server && adb start-server.
  5. Download the adb wireless app and click the big green button.
  6. Run adb connect xxx.xxx.xxx.xxx:5555, and put the IP of your android device in there (the adb wireless app will show you what it is).
  7. Push and pull stuff willy nilly! Here's a list of pertinent commands.
  8. Run adb disconnect and press the big red button.

The main commands you'll be interested in are:

adb shell ls / 
adb pull REMOTE LOCAL
adb push LOCAL REMOTE