WARNING: Your browser, IE6, released in 2001 and superseded by IE7 in 2006, is out of date. I advise that you either upgrade to IE7 or switch to a more standards-compliant browser.

Archive for the ‘Software’ Category.

ZSH: My Tale of Adventure

Hello guys, I’ve been extremely busy with homework of late. Many many reports, in addition to two finals, have kept me away from not only blogging but doing all of my normal activities.

Tonight, I took my first final and turned in much of what my headache has been. I came home a bit early, and decided tonight would be my relaxation time. I decided that since I hadn’t tried something new in a while I would try out a new linux shell, having only ever used bash (Bourne Again SHell, the default on many distros). I asked in #ubuntu-offtopic if anybody had a particular shell they suggested. tonyyarusso suggested original Bourne, so I decided I should probably just google and see what comes up.

What came up most often was ZSH. I decided, what the hell, all this hype surely can’t be for nothing. I began by installing it from the Ubuntu repositories:

sudo apt-get install zsh

Very simple. Once done, I typed “zsh” and away I went. I was immediately impressed with the start up configuration wizard. It asked if I wanted a vanilla configuration or to customize my own, and being a geek I opted to configure it myself.

There were a few levels of configuration. I changed all the settings, enabling everything that sounded neat. autocd, command correction, full tab completion, everything that sounded like it would be fun to play with. Once done, I went to gentoo’s documentation page for it and read what they had to say. I played with all the settings they listed, including setting up my own custom prompt.

I started it up and was immediately greeted with a different prompt than I’m used to. If I remember correctly, it simply said:

dmsuperman%

I decided I didn’t like that, since I like to be able to see where I’m at. I read further down the page, and after initializing the prompt package, I started playing with it. I ran ‘export PS1=”[%n@%m:%~]“‘ and was greeted with my new prompt:

[dmsuperman@blitzkrieg:~]

Much better.

Once my prompt was how I liked it, I began toying with various features. Here are my findings:

  • Tab completion is far superior to bash. It’s much more like how irssi handles tab-completion, where if you begin to type something, then tab, it will complete until it finds a conflicting character and stop. If you hit tab again, it will show you a list of all possible options, and if you hit tab one more time it will begin cycling through that list of options. I find this to be better, since the whole point of tab is that I can type as little as possible.
  • autocd rocks. It simply does. Type “..” and it understands that you want to go up a directory. Type “/etc” and it changes to “/etc”. This is awesome, because often I forget to type cd anyway.
  • Extended globbing also rocks. Finally, I can type “du -chs ./(A|B)*” and see how much disk space all of the items in a folder that begin with A or B take up.
  • Command correction is very helpful. If I type “mplzyer”, it will ask me if I meant “mplayer” and offer to always correct mplzyer to mplayer in the future
  • zsh has many neat prompt styles built in, with the ability to preview them. Typing “prompt -p” gives me a large list of named prompt styles and previews of each. Here are just a couple: elite2 theme with parameters `magenta':
    (dmsuperman@blitzkrieg)(129/pts/10)(09:36pm:02/23/09)-
    (%:~)- command arg1 arg2 … argn

    oliver theme:
    dmsuperman@blitzkrieg ~ % command arg1 arg2 … argn

    redhat theme:
    [dmsuperman@blitzkrieg ~]$ command arg1 arg2 … argn

    suse theme:
    dmsuperman@blitzkrieg:~/ > command arg1 arg2 … argn
  • The .zshrc file is much smaller than .bashrc. My .zshrc is under 15 lines, where my .bashrc is over 100

Shortly after playing with all of these new features, I changed my shell from bash to zsh permanently, and am now using it happily. I suggest you all at least give it a try. Here is my finished .zshrc:

# Lines configured by zsh-newuser-install
HISTFILE=~/.zsh_hist
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory autocd
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename ‘/home/dmsuperman/.zshrc’

autoload -Uz compinit
compinit
# End of lines added by compinstall

# Command correction
setopt correctall

# Prompt style
autoload -U promptinit
promptinit
export PS1=”[%n@%m:%~]“

# Extended glob
setopt extendedglob

# Load aliases
. ~/.zsh_aliases

Simply save this as your .zshrc and run it and you should be able to achieve what I have described above. Sorry bash, move over because zsh is the new shell for me. Until I find the next new thing to play with, at least.




I just wanted to add here, that I got tickets for Lamb of God’s upcoming tour and I am amped beyond all belief. Myself and a few friends from work (including butters) are all going to head over to the show as early as possible. It’s going to be sick. Anybody in the Columbus area that’s going, feel free to let me know, maybe you can come with us or something.

GNOME Do 0.7.95.1 with new docky theme

Let me start by telling you about my potential bias: I have long wanted a good linux dock. AWN simply doesn’t cut it. It’s very buggy, crash prone, and the interface is just very odd to work with, from my personal experience. Cairo dock is another option, but it’s even buggier than AWN, not to mention the fact that the preferences window is the most insane “design”, if one could call it a design, I’ve ever seen.

After trying both of these options on numerous occasions, I reserved myself to just using the simple gnome-panel tasklist applet. It works, it lets me see what I have open, and it’s not extremely buggy.

That is, of course, until I was in the #ubuntu-offtopic channel the other day, and “overheard” Amaranth and DBO talking about a new dock.

I started reading my backlog, then once I was caught up I started talking to DBO. What he was describing was basically the perfect dock. The icon zoom worked and worked properly, it supported reading the windows correctly so there weren’t the bugs typically associated with docks, and, here’s the kicker, it integrates with one of my favorite productivity applications, GNOME Do. What’s more, it had intelligent window grouping and selection, to get you to the proper window quickly.

So I started talking to DBO, and he told me that I wouldn’t be able to run it in Hardy because it doesn’t support Mono 2.0. My heart was crushed.

However, a few days later, I was back in #gnome-do, and DBO told me that I might be able to run it in Hardy with a custom Mono. What followed was a bunch of testing, trying, and eventually building. After adding in a custom repo and installing extra mono packages, and replacing my /usr/lib/mono/2.0/gmcs.exe with a custom one, I was able to use it.

I quickly finished installing it and loaded it up, then began to use it. The first thing I noticed was that it integrated itself as gnome-do, not just added upon it. Now, when I summon do, it brings it up down as my dock, which only makes things sexier:

Snapshot of docky integrating gnome-do's functionality

It also fully implements grouped windows (though, at first this was giving me issues, DBO soon resolved the issue, thanks =D). You can control the group, or individual ones. Clicking on the main icon for a group is also intelligent. If something demands attention, then it goes to that window, otherwise there are other rules to help ensure you get to the window you want.

Docky with grouped windows

It maintains all the old functionality:

Showing the old define function with the new docky

While updating some of the plugins (for instance changing Twitter to Microblogging to add Identi.ca support):

Microblogging plugin picture

And it also completely implements dual-monitors, for those of you who use them:

Do with the options dialog up

That’s not to say it’s without hitches. I’ve found that it doesn’t seem to like /usr/share/applications/lynx.desktop, because of (I can only assume) the Russian characters. I’ve deleted this file to get it to work.

Also, it doesn’t yet have support for workspaces. The icons you see are the icons from all your workspaces. I keep prodding DBO about that, hopefully he’ll get around to it.

I have some issues with it at work, the performance is really bad, but that’s not saying much because I’m running an 8600GT which seems to have been affected by the powermizer bug.

Lastly, since I’m using 4 monitors, with 2 screens, the “Switch monitors” button gets a little confused, trying to flip to the third monitor in my first screen, which doesn’t exist. As far as I know, DBO is currently working on this, or will be in the near future.

Here are some notes for those of you who want to try it out:

If you want to run it, in Hardy at least, you’ll need a custom mono. First, add the following to your /etc/apt/sources.list:

# custom mono
deb http://ppa.launchpad.net/directhex/ubuntu hardy main

Then update your repository cache:

sudo apt-get update

And finally install your custom mono 2.0:

sudo aptitude install mono-2.0-service mono-2.0-devel monodevelop

These are the commands that worked for me.

When I first ran it, I needed ot put in my own gmcs.exe, but with some updates by RAOF, it now automatically does that for you, so you don’t need to worry about doing it.

Once you’re done, check out gnome-do and do-plugins by cd’ing to a working directory and executing the following 2 commands:

bzr branch lp:do
bzr branch lp:do-plugins

Once done, go into each and install them:

./autogen.sh
make
sudo make install

Once you’re done, go and delete ~/.local/share/gnome-do/plugins* to remove your old plugins and configuration, if you already have gnome-do.

Finally, run gnome-do, then go to the Appearence tab and change the theme to docky. Voila! You have the greatest dock and productivity bar ever!

Thanks for all the help djsiegel, RAOF, DBO, and everybody else who helped!

Short video of me using it:

Twitter