Archive for July, 2010

while I wasn’t doing my job…

July 27th, 2010

I’ve been wanting a (good) way to get notifications from irssi in the foreground for a while now. Let’s say, oh, two years.

My irssi setup is fairly standard: irssi running in screen on a remote server. There’s a few ways people have come up to run around this:

  • Run the SSH session with X forwarding and use notify-send to pop up new messages
  • Run a second SSH session to access a fifo of new messages and pop them up as they come
  • Move your windows around so that you can always see the status bar at the bottom of irssi

The first two are, if you’re not careful, prone to attack — the most basic bash script to send messages to notify-send can easily run commands to remove files, etc., if you don’t escape quotes. The third one is impossible if you use a tiling window manager like awesome.

Since I use awesome, it’s really stupidly easy to create a widget in the status bar at the top. Add something along the lines of this to your rc.lua:

myirssistatus = widget({ type = "textbox" })

Add it to the wibox:

-- Create the wibox
mywibox[s] = awful.wibox({ position = "top", screen = s })
-- Add widgets to the wibox - order matters
mywibox[s].widgets = {
    {
        mylauncher,
        mytaglist[s],
        mypromptbox[s],
        layout = awful.widget.layout.horizontal.leftright
    },
    mylayoutbox[s],
    mytextclock,
    myirssistatus,
    s == 1 and mysystray or nil,
    mytasklist[s],
    layout = awful.widget.layout.horizontal.rightleft
}

And it’s there. Of course, it’s empty. That’s where the combination of an irssi script and a bash script come into play.

The irssi script activity_file.pl simply spits out a CSV file listing the IRC channels your in, in the following format:

num,act,channel,network

num is the channel number, act is an integer representing channel activity (0 for none, 1 for crap, 2 for messages, and 3 for hilights), channel is, well, the channel (e.g., #fedora-devel) and network is the name of the network that channel is related to (see /help network). Everything you need.

The script spits that data out to ~/.irssi/activity_file, and I have it symlinked into somewhere in ~/public_html (not the most secure, but it’s not like there’s any personal information in my channel list), and this bash script picks it up and runs with it:

#!/bin/bash

trap cleanup 2

cleanup()
{
	echo "myirssistatus.text = ''" | awesome-client
	exit 0
}

while true; do
	DATA=""
	for line in $(curl -s URL_GOES_HERE); do
		win=$(echo $line | cut -d ',' -f 1)
		sta=$(echo $line | cut -d ',' -f 2)
		if [ "$sta" = "1" ]; then
			DATA="$DATA $win"
		elif [ "$sta" = "2" ]; then
			DATA="$DATA $win"
		elif [ "$sta" = "3" ]; then
			DATA="$DATA $win"
		fi
	done
	if [ "$DATA" ]; then
		DATA="$DATA  "
	fi
	echo "myirssistatus.text = \"$DATA\"" | awesome-client
	sleep 5
done

The key there is when it pipes data into awesome-client. That’s really frickin’ neato.

So anyway. Is it a hack? Yes. Is it pretty? No. Does it work for me? Hell yeah. :)

Tags: , , , , | Comments Off

hello from CLS

July 17th, 2010

This is my postcard home to Planet Fedora:

PLAY SUSPENDED DUE TO HIGH WINDS LOL

Comments Off

hitting the road, v2

July 13th, 2010

Max wrote a post on our trip to Santa Cruz and Portland, but he glossed over a few things. I rewrote his post correctly below.

Ian and I will rush to the RDU airport tomorrow and hope to $DEITY that Delta assigns us seats on our flight to San Jose, where we will meet up with Karsten and Mel to eat In-N-Out for three days. This will be the first time since October that all of us are in the same state, and it will give us a chance to see where we stand on the 14 yellow cards given at the World Cup Final. This will ensure we’ve got our priorities aligned and plan a solid future for the team.

We’ll also be crashing the Community Leadership Summit and OSCON. A few members of the community are coming to assist with the impending invasion of blue-shirted ensigns. We also have a couple of presenters at OSCON, which will help us crash the par-tay even more.

Everyone on the team will be communicating to the Fedora Orbital Laser using semaphore about what we’re up to this entire week, and the FOL will beam it directly to all of your minds. I’ve also assigned Ian to write an opensource.com article, which I expect to solve world hunger.

Oh, I almost forgot!

BRBRBRBRBRBR

HUP HOLLAND

(The above is a parody. Max, don’t fire me.)

1 Comment »

another double post: Fedora’s fonts and more datanommer

July 12th, 2010

First off, fonts. The Fedora Project has used MgOpen Modata for a while now as its official font. It’s a free font and loosely resembles the font in our logo.

We just have a few issues with it — namely, it doesn’t support a lot of glyphs needed to even spell some of our contributors’ names, let alone speak in other languages. Here’s a few examples of where MgOpen Modata fails:

Three examples of MgOpen Modata not having enough characters

The top two are names of Fedora contributors. The accents versions of letters above are not available in the font, so in Inkscape, they are replaced by the system default font (which I believe is DejaVu). Those are highlighted in red. The third line is a line in Russian, nabbed from the Russian translation of the wiki’s home page. The only character in that line rendered as Modata is the question mark at the end of the line.

Mo kicked off the discussion on finding a new font a little over a week ago. As the discussion continued, it was decided that the best candidate for the font was Comfortaa, a font licensed under a CC BY-ND license, which is not permissible for inclusion in Fedora. Mo sent an email to the font author asking for the license to be changed, and we received wonderful news back.

That’s not to say the search is over — we still need your feedback and suggestions. We don’t plan on using Comfortaa as a body text font, only as a headline font; the front runner is Droid Sans (Droid Serif for print). If you can suggest a better typeface for either the headline or body text fonts, please let us know! Either comment on this blog post or send an email to the design-team list.

Edit: Here’s some samples of Comfortaa, as suggested by Nicu.

Comfortaa Regular sample
Comfortaa Bold sample

Second, datanommer. (om nom nom) A couple of weeks ago, I posted to the datanommer list a totally new way forward for the datanommer project, based on feedback from the target audience to datanommer as well as members of the Infrastructure team.

The new new master plan is to provide a simple executable, aptly named “datanommer”. It reads a configuration file which specifies queries to be run on different applications. Here’s an example query file, currently checked in to the git repo:

[memcached]
servers = 127.0.0.1:11211

[module:wikipedia]
path = mediawiki.MediaWiki
api_url = http://en.wikipedia.org/w/api.php

[data:wikipedia.recently_active_editors]
grapher = matplot.bar_chart
grapher.ylabel = Edit count
num = 10

[module:fedorawiki]
path = mediawiki.MediaWiki
api_url = https://fedoraproject.org/w/api.php

[data:fedorawiki.recently_active_editors]
grapher = matplot.bar_chart
grapher.ylabel = Edit count
num = 10

Now, what on earth does this do? It fetches up to the latest 1000 edits on a MediaWiki, specifically the Fedora Project’s wiki and Wikipedia, determines the top ten editors, and places them on a bar graph created with matplotlib. The Fedora Project graph looks something like this. Neato!

Next up — the part I’m planning to work on this week — is the part that creates an HTML presentation for the data. Of course, totally configurable. After that, it’s the endless process of writing code to pull data from miscellaneous applications. Which you, of course, can help with. (Documentation coming soon!)

Tags: , , , , , | 3 Comments »