elarson’s posterous

 
Filed under

linux

 

Getting Back to Basics

At work there were some changes to the VPN server that seemingly made my ability to connect something of a problem. It turned out to be an issue with my home router, but in the process I went ahead and tried working on Linux instead of OSX. At work other folks are pretty happy with tiling window managers such as Ion3 and AwesomeWM, so I gave some a try. It has been a while since using Linux on the desktop, but it was a surprisingly nice experience. Since then, I went ahead and have gotten my ubuntu partition up to snuff and have been using it full time.

The window manager I settled on is called StumpWM. It is written by the same guy who did Ratpoison with the major difference being that Lisp is used instead of C. You are able to manage windows in the same way you manage frames in Emacs, so it feels pretty comfortable to an Emacs user. While it was easy to get started using StumpWM, there were still things that needed to be setup. Specifically, getting my VPN to stable place was something of a blocker.

I found that in Gnome, things worked pretty well. NetworkManager made the VPN setup a cinch (although I did figure out how to get things working with pon/poff). I wanted to effectively have Gnome for setting up all the niceties such as a tray and NetworkManager. My first step was to try StumpWM with Gnome. This was pretty easy by setting an environment variable in a .gnomerc file.


export WINDOW_MANAGER=/usr/bin/stumpwm


The problem with this was that the panel and nautilus desktop were both frames in StumpWM. It just didn't feel right. What I did eventually was find trayer, a system tray replacement that only has a tray. It is really simple and it made running nm-applet really easy. There is a really cool screencast showing off StumpWM that showed starting the gnome panel and it working directly with StumpWM, but it didn't work for me. Likewise, there were a bunch of example configuration files that I tried to pull from that didn't work. Eventually it became clear I was using an old version of StumpWM. When I upgraded, things were much nicer. The documentation magically became correct and I could script things as needed in my StumpWM config. I setup my two monitors and things have been smooth sailing. Here is my StumpWM for reference if anyone is interested:

[code]

;; -*-lisp-*-

(in-package stumpwm)
(run-shell-command "python ~/xstart.py")
(define-key *root-map* (kbd "C-.") "gnext")
(define-key *root-map* (kbd "C-,") "gprev")

(defcommand firefox () ()
  "Start/Switchto Firefox."
  (run-or-raise "firefox" '(:class "Firefox")))

(define-key *root-map* (kbd "f") "firefox")

(run-shell-command "/usr/bin/trayer --edge bottom --SetDockType false --transparent true --expand false --align center &")
(run-shell-command "/usr/bin/gnome-settings-daemon &")
;;(run-shell-command "/usr/bin/gnome-panel &")
(run-shell-command "/usr/bin/nm-applet &")
(run-shell-command "/usr/bin/bluetooth-applet &")
(run-shell-command "/usr/bin/pactl load-module module-x11-xsmp &")

(set-prefix-key (kbd "C-i"))


;; create groups
(run-commands
 "gnewbg System"
 "gnewbg Web")

;; (run-commands "exec gnome-settings-daemon")

(setf *window-border-style* :thin)

;; Turn on the modeline
(if (not (head-mode-line (current-head)))
     (toggle-mode-line (current-screen) (current-head)))


;; Show the time in the modeline
(setf *screen-mode-line-format*
      (list '(:eval (run-shell-command "date '+%R, %F %a'|tr -d [:cntrl:]" t)) " | [^B%n^b] %W"))

(setf *mouse-focus-policy* :sloppy) ;; :click, :ignore, :sloppy

[code]

Most of the startup commands that are run I took from the gnome session editor where they are listed. The python "xstart.py" script just uses xrandr to setup my second monitor if it is connected. I could see that being an issue if I ever give a presentation, but honestly I'd probably just end up using something like Gnome or OSX if it were really that big a problem.

So far, I'm really happy with the setup. It is nice to be able to focus on primarily using the keyboard and the opportunity to continue to customize my environment seems like a healthy way of improving my knowledge of *nix and programming in general. What's more, it is nice to know I'm primarily using free software again. Beyond things not costing much, I have the opportunity to do whatever I like with the code. It may not seem like a big deal, but knowing that I have the ability to change the code as I need to is a pretty powerful concept.

Filed under  //   emacs   linux