jasonwryan

Recent notes, thoughts and saves...

Jan 26, 2012 4:10pm

My top tracks

Libre.fm have added some nice graphs to their stats page. It gives you a pretty good picture of the music that you have played since joining the service, and includes breakdowns by artist and track and the number of tracks scrobbled per day.

Not that it comes as any real surprise, but my top twenty artists are—with the notable exception of Sly and the Family Stone (and even they would probably squeeze in when you see that it is mostly tracks from There’s A Riot Goin’ On)—jazz:

You can see all the details on my Libre.fm profile

1 note
Jan 23, 2012 12:21pm
New technologies provide new ways to satisfy new consumer demands and to thereby make healthy profits. You would never know that from the medieval mentality of moat building represented by the DMCA and copyright industries’ approach to most new technologies, an approach that has failed to grasp the simple point, proved over and over again, that new technologies create new opportunities.
— William Patry, How to Fix Copyright, pp. 46-47.
Jan 8, 2012 10:03am

monsterwm

If you have visited here at all over the last couple of weeks, you would have seen some screenshots from my Flickr stream of a new window manager, monsterwm. Over the break, I have been playing around with it and, despite the fact that the project is only really a few weeks old, it is well worth a look.

Originally a fork of dminiwm, which was in turn based on catwm and dwm1, monsterwm for me—having used dwm for years—feels very much like a stripped down version of dwm, with a few of the patches (like pertag, for example) built in.

One of the projects goals, like it’s antecedents, is to keep the SLOC low. By way of comparison, dwm’s long-standing goal has been to keep the SLOC below 20002. monsterwm’s current count is under 700. One of the ways that monsterwm achieves this is not to incorporate a status bar; as the README says:

Monsterwm does not provide a panel and/or statusbar itself. Instead it adheres to the UNIX philosophy and outputs information about the existent desktop, the number of windows on each, the mode of each desktop, the current desktop and urgent hints whenever needed. The user can use whatever tool or panel suits him best (dzen2, conky, w/e), to process and display that information.

So, what is it like to run? Obviously it is fast. It comes with four tiling modes: standard tile, backstack, grid and monocle and, as mentioned above, the ability to define different layouts per desktop. There are still a couple of features to be implemented; floating mode being one of the more significant and a couple of minor bugs—as you would expect for a project still in its relative infancy.

Overall, it is a very nice, minimalist window manager. If you don’t use the dynamic tagging feature of dwm, then this would be a window manager to consider switching to. The developer, Ivan “c00kiemon5ter” Kanakarakis, has been extremely responsive to user’s suggestions and requests (the thread on the Arch boards is quite active) and has been admirably clear about his vision for the wm.

You can see my monsterwm configs in my mercurial repository.

4 notes
Jan 4, 2012 8:50pm
Dec 30, 2011 4:40am
1 note
Dec 28, 2011 12:56pm
Dec 23, 2011 12:51am
1 note
Dec 20, 2011 10:04pm

monsterwm

Monster on EeePC

monsterwm on my EeePC…

8 notes
Dec 18, 2011 10:13pm

Logging straight into X

I have been using CDM to log into X on my Arch machines and, if I were to continue to require the ability to access different window managers with any frequency, I would use this approach. However, on my EeePC, I really only ever login to a dwm session or the console, so having a login manager seemed like an unnecessary step.

Consequently, over the weekend, with the help of the Start X at Boot article on the Arch Wiki, I removed CDM and arrived at a secure, flexible approach to logging into X (or the console).

My /etc/inittab already boots me into runlevel 5:

# Boot to X11
id:5:initdefault:

So it was just a case of putting a couple of lines in the correct invocation file. I chose ~/.bash_profile because I only use Bash; if you use another shell you should probably go with ~/.profile. The recommended lines from the Arch Wiki are:

if [[ -z $DISPLAY && $(tty) = /dev/tty1 ]]; then
  exec startx
  # Could use xinit instead of startx
  #exec xinit -- /usr/bin/X -nolisten tcp vt7
fi

…and this works as advertised. If you are in TTY1 and you login, X is started. The disadvantage for me, though, was that when you shutdown, you must manually change to TTY7 (if that is your last agetty) to see the shutdown messages.

After rummaging around through various man and web pages, I finally alighted on this helpful option: -novtswitch. So, my entry to start X now looked like:

# startx if on tty1
if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then
    xinit -- :0 -novtswitch &>/dev/null &
    logout
fi

Now, on shutdown and reboot, I see all of the shutdown messages. All that remained was to add an option to log into a tmux session if I didn’t want to use X. The final code looks like this:

# startx if on tty1 and tmux on tty2
if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then
    xinit -- :0 -novtswitch &>/dev/null &
    logout
elif [[ $(tty) = /dev/tty2 ]]; then
    tmux -f $HOME/.tmux/conf new -s secured
fi

Logging in from TTY1 takes me into my dwm session, if I switch to TTY2 I am logged into a tmux session with keychain running. To start consolekit with dwm, I have this in my ~/.xinitrc: exec ck-launch-session $HOME/Scripts/dwm-start. You can see my full ~/.bash_profile in my intuxication repo.

1 note
Dec 13, 2011 7:28pm

SimplyRead

A post on the suckless mailing list this morning announced a browser plugin called SimplyRead that removes all the cruft from a page and allows you to just focus on the relevant content—the stuff you are trying to read.

It’s probably easier to show the difference. Before:

Hit Altr, and Boom! Distraction free reading:

Particularly good for long-form articles…

2 notes
Dec 9, 2011 1:15am
1 note
Dec 8, 2011 12:48am
4 notes
Dec 3, 2011 7:50am
PhotoAlt

From longreads:

And with that little programming exercise, a second door cracked ajar. It was to swing wide open during the summer of 1969 when Thompson’s wife, Bonnie, spent a month visiting his parents to show off their newborn son. Thompson took advantage of his temporary bachelor existence to write a good chunk of what would become the Unix operating system for the discarded PDP‑7. The name Unix stems from a joke one of Thompson’s colleagues made: Because the new operating system supported only one user (Thompson), he saw it as an emasculated version of Multics and dubbed it “Un-multiplexed Information and Computing Service,” or Unics. The name later morphed into Unix.

The Strange Birth and Long Life of Unix.” — Warren Toomey, IEEE Spectrum

10 notes
Dec 1, 2011 6:43pm

Readline bindings in vi mode

I recently threw caution to the wind and changed my shell over to vi mode. I wanted to take advantage of the superior command editing ability that this mode offered, and also to continue to bake vi[m] methods into every aspect of my working environment.

The change has been relatively straightforward; the only issues I have experienced are really just around a couple of keybinds that I had become accustomed to in normal/Emacs mode:

  • Alt+. to recall the last argument of the previous command(s)
  • Ctrl+l to clear the screen in insert mode

The first, the ability to recall the final arguments of previous commands was a showstopper for me: I really struggled without this. Being able to recall a long file path and append it to a new command is invaluable. Fortunately, there is the yank-last-arg command that does exactly this. Why it is not bound by default in vi mode is beyond me…

The other was purely cosmetic, really. I am an inveterate clearer of the screen—unless I am referring to something printed to stdout, I always prefer to work at the top of the console.

In any event, with the bindable readline commands, it was a trivial exercize to restore this functionality to my bash shell in vi mode. I created ~/.inputrc, and added the requisite binds:

$include /etc/inputrc

# for vi mode
set editing-mode vi
$if mode=vi

set keymap vi-command
# these are for vi-command mode
"\e[A": history-search-backward            # arrow up
"\e[B": history-search-forward             # arrow down
"\ep": yank-last-arg                       # bind to Alt-p
Control-l: clear-screen

set keymap vi-insert
# these are for vi-insert mode
"\e[A": history-search-backward
"\e[B": history-search-forward
"\ep": yank-last-arg
Control-l: clear-screen
$endif

There is an extensive list of readline commands and variables with which you can customize your shell environment.

8 notes
Nov 29, 2011 9:21pm

Building rtorrent on Debian Squeeze

After setting up my server, I wanted to use it as a torrent box. The version of rtorrent in the Debian stable repositories is 0.8.6, which is unfortunate as support for magnet links was introduced in 0.8.7.

To remedy this, I decided to build the current stable version of rtorrent, 0.8.9. At the same time—seeing as I was getting my hands dirty anyway—I thought I’d patch in colour support.

This is a straightforward two-step process. First, build the current version of libtorrent, 0.12.9:

wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.12.9.tar.gz
tar -xvf libtorrent-0.12.9.tar.gz 
cd libtorrent-0.12.9/
./configure && make
sudo checkinstall1

Once libtorrent is successfully built and installed, you can begin the rtorrent build:

wget http://rtorrent.rakshasa.no/downloads/rtorrent-0.8.9.tar.gz
tar -xvf rtorrent-0.8.9.tar.gz 
cd rtorrent-0.8.9/

Then, if you want colour support, you need the patch. I used the version in the AUR, but you can also grab a copy from a paste site:

wget -O canvas_colour.patch http://paste.geekosphere.org/twy7
mv canvas_colour.patch src/
patch -uNp1 -i canvas_colour.patch

The patch should apply cleanly. Then specify where libtorrent is installed to ensure that it is linked during the rtorrent build:

./configure --libdir=/usr/local/lib
make
sudo checkinstall

Once again, this should compile cleanly and you will now have rtorrent with colour and magnet link support installed in /usr/local/bin/rtorrent.

4 notes
Page 1 of 272