A prettier Terminal in OS-X Part 1 (awesome is awesome!)
o I recently switched over to awesomewm on my desktop because either the desktop wm’s suck(kde,gnome) or fluxbox,fvwm weren’t quite what I needed.
So I went looking for a good terminal that supports 256 colors. There’s mrxvt and whatnot, but again the Probleme with these is that either utf-8 is missing or they’re in some other way ugly, dependency wise or whatever.
Then there’s this nifty term called urxvt(apparently it doesn’t seem to follow ecma-48?). Anyway, I like it and although iTerm does support 256 colors, it’s rather slow imho.
The end result could look like this…
The dependencies I used for installing awesome look as follows:
- pango
- imlib2
- libconfuse
- XQuartz (2.3.2.1 at the time of this writing)
If you use macports 1.5 and XQuartz 2.3.2.1 you should remove the cairo dependency from pango. Otherwise awesome might link to XQuartz cairo while pango links to macports cairo causing an annoying crash while restarting, connecting the second head or closing X11.
sudo perl -ni -e 'print unless /pkgconfig\/cairo/' /opt/local/var/macports/sources/rsync.macports.org/release/ports/x11/pango/Portfile
then you can probably do the following to install awesome(awesome.diff fixes a configure issue on osx, you can find it here ):
sudo port install pango imlib2 libconfuse
wget http://awesome.naquadah.org/download/awesome-2.3.4.tar.bz2
tar xjvf awesome-2.3.4.tar.bz2
cd awesome-2.3.4
patch -p1 < ../awesome.diff
./configure --prefix=/opt/local
make
The build will probably fail somewhere in between because of defconfig.h . If so you can use the following command to fix it:
# this can probably done much better but meh, i don't know sed syntax too well, -i '' means edit in place sed -i '' -e 's/DEFAULT_CONFIG =.*$/DEFAULT_CONFIG = "\\/' -e 's/-n ".*$//' -e '/./!d' defconfig.h
Afterwards finishing the build you will probably want to create an ~/.xinitrc file and add the following to it:
#!/bin/sh #unless you want the annoying bells or visual bells keep the following 2 lines xset b off xset b 0 0 0 # the fork switch won't work on osx, so no -f here export RXVT_SOCKET=$HOME/.rxvt_socket urxvtd -q -o & awesome
Also if you use an exotic shell config(eg. with zsh) it might break X11 a bit unless you put the following in your ~/.x11run
#!/bin/bash exec -l "bash" --login -c 'exec "${@}"' - "${@}"Don’t forget to run
chmod +x ~/.x11run
afterwards(note this is a pretty new feature of XQuartz.
I’ll continue next time on how to setup urxvt. Meanwhile you can use xterm which also has 256 color support, however XQuartz xterm won’t detect terminus font if you decide to use a non antialiased font.
UTF-8 and bom problems in php
So I was trying to debug on of our Sites because we we were having an odd sign at the beginning of the files.
Turns out it was a BOM at a database model somewhere totally different from the output phtml. If you got any windows developers using Ultraedit in your team give them a hearty punch from me. :-)
But since I didn’t know where it was from and what it is at the time I opened the result in a hexeditor and searched for the beginning(for the record, Wikipedia has a list of the different UTF BOM’s but most editors hide them):
grep -r `perl -e 'print "\xef\xbb\xbf"'` *
Better tab completion for scp file names
As a lot of you may know, zsh offers tab completion for scp: filenames. Normally it would connect and then list the files. As you can imagine this isn’t really that efficient. The solution is quite simple… By adding
Host * ControlMaster auto ControlPath ~/.ssh/master-%r@%h:%p
to the top of your .ssh/config all your connection will automatically create a master connection. As such all subsequent connections will pass through the master. Who’d know it makes scp like browsing a local filesystem. Combined with vim’s netrw I’d say that’s pretty neat.
New Skype themes in OSX
So yesterday skype released a new version of Skype for Mac. You con get it here.
I know skype is evil and stuff but anyway they released a new theme that is used for the Mood chat. Sadly you cannot chose it as default message font, so what to do? Well a simple 3 liner in Terminal allows you to use it as default chat style.
Open Terminal.app or whatever your favorite Terminal is(mine is urxvt) and type in the following:
mkdir -p ~/Library/Application\ Support/Skype/ChatStyles cp -r /Applications/Skype.app/Contents/Resources/ChatStyles/MoodMessage.SkypeChatStyle ~/Library/Application\ Support/Skype/ChatStyles/MoodStyle.SkypeChatStyle sed -i '' -e 's/moodmessage/moodstyle/' ~/Library/Application\ Support/Skype/ChatStyles/MoodStyle.SkypeChatStyle/Contents/Info.plist
Now you can set MoodStyle in Preferences/Chats/Style.
However I wasn’t quite happy with this solution, so I read about Skype supporting Adium message styles. Well… tough luck, turns out they dropped support for Adium message styles a couple of months later. Turns out it they didn’t completely drop it, just mod it a bit. So I sat there last night and stitched together a version of renkooNaked that works in Skype.
The downside: The fonts gonna be messed up if you use any non 11 size, since the first line will always be 11px. Also, you should select the font once to set it properly.
Anyway, this is how it’s going to look(just click on the picture to download):
