Skip to main content

An Update to 'Window Managers?'

Way back, I wrote a quick blurb on Window Managers for running under X.

Well, a while back I switched to Ubuntu for my OS of choice. As you may know, the fine folks at Ubuntu switched to default window manager to something called Unity, which caused a stir. I tried it for a while, but decided that it was too heavy, and too mouse-centric.

So, what to do? Well, I went back to my old standby wmfs, Window Manager From Scratch. This is a modern WM with systray support, full Ximirama and Xrandr support, tiles, and is mainly driven from the keyboard. Life is good.

To install (same steps as for Fedora, RHEL, or Ubuntu), download the source, and install the needed development libraries for: X11, Xft, freetype, Xinerama, Xrandr, and Imlib2. I used the native packages from the OS. Then, simple do a

make
sudo make install

(you do build software as a normal user, right?)

This will install all the needed bits and configs into the correct place. Under Ubuntu 11.10, there was an entry from the login screen to let me chose wmfs.

Config is handled in $HOME/.config/wmfs/wmfsrc which you can copy from /etc/xdg/wmfs/wmfsrc.

EDIT 2016-11-30: It seems the domain is no longer active. The wmfs website has very nice documentation as well as likes to some people’s configs with screen shots.

It runs very fast, and very lean:

 Private  +   Shared  =  RAM used       Program
  3.9 MiB + 310.0 KiB =   4.2 MiB       wmfs

Check it out, I am sure you will like what you see.

cmus project restarted

cmus project restarted

Just a quick note. The cmus project has been restarted recently, and they are working on a new release. This one should have better integration with things like PulseAudio.

Good news!

Go check out http://cmus.sourceforge.net/ for more details.

Making life easy over flaky links

Making life easy over flaky links

I tend to work over VPN, which we know can be flaky at times, Since I work on server, I spend a lot of time ssh’ed into hosts. I was getting tired of the lost time having to restart what I was working on every time the VPN dropped (which could be as much as every 15 minutes on a bad day). While I already used screen to handle the lack of terminals (Alas, I am forced to use a Windows laptop to VPN in with), I thought there could be an easier way to do this.

The way I tend to work is that I ssh into a jump server, fire up screen, then ssh into the hosts I need to work on, and fire up screen on those hosts.

Now, this is nice, but it can get a bit tiring to do it all over again. So, I found a tool called autossh which will automatically restart your ssh session if it drops for any reason but a graceful disconnect. (Well, there are others, but this is basically it). Combine this with your ssh-agent, and you can re-attach with easy. I also use keychain to help manage my ssh-agent when I log in.

Now that the connection will come back, I need a way to re-attach to my screen session, or if there is not one, to start one for me. To do
that, I have this is my .bashrc file:

test -x $STY && screen -xR

This will check to make sure that we are not already inside a screen session on the local host (test -x $STY), and if we are not, then either attach to an existing screen session or start a new one (screen -xR)

I have define this function in my .bashrc to spawn a new ssh connection in a separate screen window:

function ss ()
{
  screen -t $1 ssh $*
}

Easy stuff

Search your email!

Search your email!

One of the features that most of the pretty GUI mailers offer you is the ability to search your email. While this is not a feature I use regularly, it is one which when you need it, you really need it. I have used grepmail in the past, but it slow for me (it scans the mail files every time) and the big thing for me is that is only supports mbox files, and I use maildir since I use offlineimap.

I recently found mairix. While I have not been using it long, so far I am very impressed with it. It uses an index to speed up the search process, and it smartly adds only new or changed files to the index. The first indexing run was only a few seconds on my archive of almost 15,000 mail messages. I have it scheduled to update the index every 15 minutes, and I never notice the load this will put on the system.

To integrated mairix with mutt, I wrote a quick little script to search from within (or without) mutt:

#!/bin/bash
#===============================================================================
#
#          FILE:  mailsearch.sh
#
#         USAGE:  ./mailsearch.sh
#
#   DESCRIPTION:  search mail stuff
#
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR:  Don Harper (), duck@duckland.org
#       COMPANY:  Don Harper
#       VERSION:  1.0
#       CREATED:  05/25/2009 07:03:30 PM CST
#      REVISION:  ---
#===============================================================================

rm -rf $HOME/Maildir/mfolder
echo "       t::word
              Match word in the To: header.
       c::word
              Match word in the Cc: header.
       f::word
              Match word in the From: header.
       s::word
              Match word in the Subject: header.
       m::word
              Match word in the Message-ID: header.
       b::word
              Match word in the message body.
       d::[start-datespec]--[end-datespec]
              Match messages with Date: headers lying in the specific range.
       z::[low-size]--[high-size]
              Match  messages  whose size lies in the specified range.
       n::word
              Match  word  occurring  as the name of an attachment in the mes-
              sage.  Since attachment names  are  usually  long,  this  option
       F::flags
              Match messages with particular  flag  settings.
              s meaning seen,
              r meaning replied
              f meaning flags
              prefixed by a - to negate its sense.

       The a:: search pattern is an abbreviation for tcf:

   Match words
       The word argument to the search strings can take various forms.
       ~word
              Match messages not containing the word.
       word1,word2
              This matches if both the words are matched in the specified message part.
       word1/word2
              This matches if either of the words are matched in the specified message part.
       substring=
              Match any word containing substring as a substring
       substring=N
              Match any word containing substring, allowing up to N errors  in
              the  match.   For example, if N is 1, a single error is allowed,
              where an error can be
       *      a missing letter
       *      an extra letter
       *      a different letter.
       ^substring=
              Match any word containing substring as  a  substring,  with  the
              requirement  that  substring  occurs  at  the  beginning  of the
              matched word.
       d::start-end
              Specify both start and end explicitly
"
echo -n "Enter your search string: "
read string
mairix $string
mutt -f=mfolder
rm -rf $HOME/Maildir/mfolder

Then, I bound this to “S'’ from within mutt:

 macro index,pager S "!mailsearch\n" 

This will give me a reminder of the search command, run the search, and then give me the search results in a new mutt session.

wifiroamd, Intel PRO/Wireless 3945ABG, and Fedora

wifiroamd, Intel PRO/Wireless 3945ABG, and Fedora

One of the things that has annoyed me about Fedora has been the decision to switch over to using NetworkManager to manage all network connections.

Now, on the service this has a lot of advantages. A lot of work has gone into it, and it just works for a vast majority of the installations out there. They have made it so the move from wired to wireless and back can be done without the user doing anything. They have also seamlessly tied in Dial-Up Networking if you still need a modem or use a wireless modem. They even have two-click access to your VPN which is pretty cool.

All these are things which are very good for Linux users. The biggest drawback to all this? The need for a user-space program to manage the non-hardwired connections. Which means that in order to be able to have any network running besides the good old twisted-pair copper, you have to have a little applet running as you, and it has to have a systray somewhere to display. Which means you have to be a) logged into the system and b) you have to be running a window manager which supports having a system tray. Now, Fedora gives you lots of choices for the second part now days. You have Gnome, KDE, XFCE, and LXDE. All are perfectly usable window managers. But, they still require you to be logged in to X. And, I do not use any of them.

So, what is a cli-loving Fedora user to do? Well, there is this great program called wifiroamd. It will handle the same basic tasks that NetworkManager handles. It will automatically configure your wifi interface and connect to the wifi networks or the locate hardwired NIC if it cannot. You can configure it to run scripts per connection, so for example, you can change your firewall rules for different networks (shields down at home or the office, but up full at the coffee house), or you could bring up your VPN connection when you start using a given wireless network.

One tip I picked up from the author was that if you have multiple AP’s in range, an you want to select once AP over the other, is under the /etc/wifiroamd/connections directory, simply link the AP info you do not want to the one you want:

ln essid:my_home_ap essid:bad_ap

where essid:my_home_ap is your AP with the keys and other information you want, and essid:bad_ap is the one you do not want to connect to. My neighbors have some very powerful AP’s which have a habit of showing up high than mine, but I have no problem with them now.

I have been using this set up under Fedora since FC6 days, but when I upgraded to F10, this stopped working. wifiroamd would try to scan for an AP, and not find anything. The change, it turns out, is that when I switched from using the iw3945 driver to the native iwl3945, wifiroamd could no longer see the wireless NIC due to the wpa_supplicant process, but NetworkManager could. Simply stopping and disabling wp_supplicant and NetworkManager, and wifiroamd started working again! I am a happy camper again.