GFX::Monk Home

Posts tagged linux:

 

Cool projects I learnt about at lca2012

I went to linux.conf.au this week, and learnt about some pretty awesome tech (as well as hearing some entertaining, inspiring, touching and terrifying talks from the likes of Paul Fenwick, Bruce Perens, Karen Sandler and Jacob Appelbaum).

So here’s a quick dump of cool projects I learnt about, with links where I could find them.

browser id:

Openid is not so great, due to:

  • usability / confusion (requiring a url as an id)
  • reliability (if your provider goes down, you can’t log in)
  • lock in, (hard for the user to migrate providers)
  • privacy (your provider knows every url you log into, every time)

Browserid serves one simple purpose: to prove you own an email. It’s distributed. The browser, (not a third-party server) is the login intermediary.

As an example: The login process to gmail generates a shortlived (in the order of hours or maybe days, I guess) cryptographically signed statement that you own that email, which your browser stores. Other sites just need to grab gmail’s public key and then they can themselves verify that the assertion you sent them proves you own (or can log in to) you@example.com.

Demo site: myfavoritebeer.org

Not awesome yet: There’s no browser or email provider support. But it’s developed by mozilla, has scaffolding in js to work already in all browsers. Certs are stored on browserid.org for now, until browsers implement native support (so they are just as bad as a server intermediary, but only as a stopgap).

mediastreams processing api:

Very cool demos, which are online (although they require a dev build of firefox).

css calc()

Computation in css. Very cool. There are implementations in IE and Firefox so far, and work on webkit is in progress. This is not just a convenience like SASS and friends - it allows for previously impossible mixing of units like 100% - 10px.

News on arbitrary metadata in git:

Apparently many people feel this is important for VCS interop (git-svn, fastimport, etc), and there are proposals for adding support (but it’s difficult to figure out how to do right in a way that won’t prohibit other useful things in the future).

openstack

Uses orchestra by ubuntu for deployments.

gerrit for code review. Use Jenkins plugins, pushes state notifications to launchpad. openstack wrote a patch submission tool: git-review. Rebases & pushes patchset to gerrit.

testing ctdb

Autocluster is a tool for testing clustered samba (and other things, presumably). Virtual kvm based clusters. Uses guestfish to manage volumes inside the kvm guests.

dbench for automated performance tests. Can describe any kind of IO workload.

Assessing the potential impact of package updates

Tools for spelunking package relationships (on debian at least): - Recursive depends, reverse depends, apt-cache, germinate.

misc projects / pointers

sozi is an inkscape plugin for chopping up vectors into slide presentations.

fossil scm is a VCS that tracks docs, wikis, bugs, etc in with the source code. Cool idea, apparently some bad implementation decisions though.

safe-rm: replaces rm and has a blacklist of folders you probably don’t really want to remove, such as /usr/. No more bumblebeeing (can’t find the link, but there was once a bug in the bumblebee uninstall script that removed all of /usr as root).

handbag makes android accessory dev easy(er)

libvirt-sandbox: new library and command-line tools for app-level sandboxing with LCX and/or KVM. Should be coming in Fedora 17.

Vsualisation: gapminder.org

freedombox: 100% free tiny personal server project. Uses all open-source & federated social software like diaspora, buddycloud

instamorph: malleable plastic that’s solid at room temperature, for making ad-hoc hooks, connectors, docks, etc. The aussie equivalent is apparently called “Polymorph”.

Shellshape: A Tiling Window Manager for Gnome Shell

shellshape Today I released the first version of shellshape, a tiling window manager plugin for gnome-shell. It’s definitely pre-alpha software, and currently requires a custom fork of the mutter window manager. I’ve had some trouble getting it running due to awful packaging things (I now know far too much about dynamic linking path resolution on linux), but it should work, at least on Fedora 15. Please give it a go if you use gnome-shell - and if not, there’s more information and a demo video at the above link.

It’s got a long way to go - there are certainly bugs, and some features aren’t done right yet. But it works, and that’s pretty exciting to me after working towards it on and off for about four months.

From Ubuntu to Fedora

I recently moved from Ubuntu to Fedora. It seemed like the right time for it. I just got a new computer, so I’d have to do a fresh install of something anyway. And on the day that my computer arrived, the Fedora 15 beta was released. Perhaps it was meant to be?

Tip: Transient Notifications in notify-send

In gnome-shell (and in contrast to Ubuntu), notifications are persistent by default - they don’t go away until you dismiss them.

I have been using notify-send for some time to pop up quick messages that do not need to stick around, so I’m happy to have found how you can make individual notifications transient. If you want to make a transient notify-send message, you can do the following:

notify-send --hint=int:transient:1 [standard-arguments ...]

I’ve created a notify-send script in my ~/bin directory that sets this by default, although that depends on you having added ~/bin before /usr/bin in your $PATH

New GVim Icon

The official gvim icon (left) is showing its age. The palette seems to be from the days of 256color, there is no anti-aliasing to speak of in many variants, and it’s just generally bland. I have found a few more modern variants, most notably the tango version, but none of them looked terribly great to me.

So I set out to create a more modern rendering of the classic logo. I exchanged the round serifs for a round diamond, added some psuedo-3d shading, gradients and shadows. All in all I’m quite pleased with how it’s turned out: 128px / svg

If you’d like to use this for gvim, you should do something like this1:

mkdir -p ~/.icons
cd ~/.icons
wget http://gfxmonk.net/misc/gvim-icon-gfxmonk.tgz
tar zxf gvim-icon-gfxmonk.tgz
rm gvim-icon-gfxmonk.tgz

Then go to your system’s theme selector and pick the “gfxmonk” icon theme.

If all the other (non-gvim) icons have now reverted to the system default and you didn’t want that, you will need to edit ~/.icons/gfxmonk/index.theme and set the inherits value to the name of your preferred icon set2.

Note: the svg icon may need the norasi font installed to display properly.

  1. These instructions have been tested to work on fedora, but I fear other distros may have wildly different mechanisms for overriding icons.

  2. Forgive me if there is a better way for packaging/installing icons, this is my first attempt.

Natty UI Fumbles

While my main computer is out of action, I’ve been trying beta 2 of ubuntu 11.04 (Natty Narwhal). The biggest change in this version is the introduction of unity, but there are also a number of other UI changes. Here are some of the bad bits:

  • The new scrollbars break a few interactions that I am rather fond of:
    • Sometimes the grabber is inside the window, sometimes it’s outside.
    • If you scroll up or down by pressing the buttons a few times, and then pause to read, and then try to click the arrow again, it may have disappeared - leading to awfully surprising results.
    • You can’t use the neat trick of middle-clicking anywhere in the scrollbar pane to immediately bring the scrubber there (instead you have to find its current location, then drag it to where you want it to be).
    • If the orange scrubber is taller than the pair of arrows and you want to hit one of the arrows, it remains a moving target until you actually leave the window’s boundary.
    • After scrolling with the mouse wheel, the orange scrubber turns practically invisible, making it impossible to tell how much scrolling remains.
  • The new terminal theme makes it really hard to tell which tab is active.
  • Whenever I press alt (for example, when starting alt-tab or another keyboard shortcut) I get really distracted by the global menu flashing in and out of my peripheral vision.
  • Alt-tab raises windows but does not focus them (bug).
  • Focus-follows-mouse (my preferred setting) is incompatible with the new global menu. You can remove the global menu, but that didn’t work for me. For now, I’m having to get used to pressing F10. There’s a proposal to fix the global menu behaviour when using focus-follows-mouse, but nobody seems interested in implementing it.
  • There’s no way to make “fullscreen” mean “everything but the dock”, as it does by default for other non-auto-hide docks. I do like the combination of titlebar & top-bar though.

Given my progress on a tiling window manager for gnome-shell (more on that when it’s working, I hope), I may well end up switching to gnome-shell soon. I’ll probably try out fedora 15 in the process, I wonder how much of ubuntu I’ll miss.

My Ideal Window Manager

I’ve been using xmonad (with a slightly modified bluetile setup) for about a year now, and it’s been pretty great. But I still feel locked in to its grid sometimes, and miss the direct manipulation that a “normal” window manager (like metacity) provides - specifically allowing quick movement and resizing by using alt + mouse dragging. Bluetile has the option of floating windows, but actually moving or resizing them is so cumbersome that it’s not really worth it. I also sometimes wish that my windows could overlap, so that (while still tiled) a window can extend beyond the bounds of its tile if I want it to.

I also am a sucker for shiny things, and xmonad is far from a shiny thing (in terms of graphics). I tried out gnome-shell yesterday, and while buggy, it is exceedingly shiny. And considering that gnome-shell will not allow alternate window managers (that was a surprise to me), I have put some thought into what my ideal window manager would look like.

I’m keen to try and implement this somewhere. It’s unlikely to be xmonad, as I want builtin compositing support (and haskell is a great language, but I can barely figure out how to configure xmonad, let alone extend it). So I’m wondering if the following can be done as a plugin to either gnome-shell or mutter. Hopefully gnome-shell, as I can stomach javascript hacking a lot easier than compiling C extensions.

Also, if people know of an existing project (with compositing!) that has these sorts of features, I’d be interested to know - I don’t want to have to reinvent the wheel, but it seems like most tiling window managers are too rigid and keyboard-based for me, while most “grid” extensions to floating window managers are too manual.

So, here’s the plan:

Why Zero-Install Will Succeed

Also known by the longer title: I Sure Hope Zero-Install Succeeds, Or Else We Might All Give Up On Package Managers Entirely.

If you’ve tried to run any of my software lately, you may have noticed that it’s all distributed and packaged via Zero-Install. I’ve posted about how awesome it is, but that was just an initial impression - I’m now familiar enough with the system to expand on those impressions.

After reading that the distros have killed python yesterday, I felt compelled to write in a little more detail how zero-install solves this and many other problems right now, across platforms and languages, and for much less effort than the current packaging practices.

Bluetile: A friendly tiling window manager

I’ve recently started using bluetile instead of compiz, and I think I’m going to stick with it. Bluetile is a tiling window manager, but it’s not like all those other tiling window managers*:

  • it’s simple
  • it’s easy to learn
  • it’s built with GNOME support out of the box
  • it still supports direct manipulation style using the mouse if you just want to change a window’s size, or swap window locations. I think this is crucial for keeping it accessible to new people like myself.

* well okay, it is like those other tiling window managers. Specifically, it’s built on xmonad. But it presents a simple veneer over the vast complication that is xmonad (I should know, I tried to configure it just last week ;)).

Bluetile is, sadly, notoriously difficult to install. But there are good guides around, I used this one for ubuntu karmic.

The good news is, bluetile has recently been merged back into the xmonad mainline. And xmonad is apt-gettable (at least on ubuntu). So in theory, the next release of xmonad will make it pretty easy to run in bluetile mode, without having to compile-your-own-window-manager (which certainly does not make for a gentle learning curve). If anyone is considering playing around with alternate window managers, it’s definitely worth your while to give bluetile a go.

Etoile first impression

I’ve long been interested in étoilé. It’s a linux distribution built on top of GNUStep, aiming to provide a more modern (read: prettier and generally a bit more Apple-Like) operating system than the GNUStep base. Obviously as a mac user who has switched to linux for its openness, this is a pretty tempting idea.

Anyways, I recently downloaded the VirtualBox image to take it for a test run. Aside from there not really being much software to use yet (making it hard to take for a spin), I noticed this in the system menu. It’s probably somewhat more important to get your character encoding right if you’re going to be all fancy and have accents in your name ;)

etoile system menu

Zenity: for the user-friendly scripter

I just discovered zenity, which is a great tool for simple gtk+ interactions with a script.

It has the following types of interactions:

  • calendar (date picker)
  • file / directory selection
  • error / info message
  • list picker
  • question (yes/no)
  • progress dialog
  • systray notification
  • and more… ( see the man page )

The usage is brilliantly simple, and it’s very unixy despite being a GUI tool. I just wrote a pygtk+ app to do some photo importing stuff, but doing it with zenity would have been far simpler.

Well worth keeping in mind for your next user-friendly shell scripts (particularly for the more advanced progress, calendar and list picker dialogs).

Is there such thing as a Snapping Window Manager?

..in which I propose a potentially-new window management feature, and hope that somebody has already done it so that I won’t have to…

A thought or two about application launch window focus models

Note that here I’m talking about windows getting focus when they launch, rather than focus-follows-mouse or window click-through (I’ll leave that one to Gruber).

Recently, I’ve learnt something about how window focus works on OSX, and subsequently been fairly disappointed by how it works in X (and probably Windows, but correct me if I’m wrong).

OSX-style horizontal mouse scrolling for linux

OSX has this great feature where if you hold down SHIFT at the same time as using your mouse scroll wheel, it’ll scroll horizontally instead of vertically. If you don’t have a laptop, this is an immensely useful trick. Sadly, I couldn’t find any way to get this to happen on linux.

But now, thanks to some direction from stackoverflow, I finally figured out how to do it myself. The world of X11 input hackery is somewhat twisted and full of projects either abandoned or in disrepair, but I finally stumbled across the right set of tools.

If you’d like to get this (rather excellent) feature in linux, you will need the following:

  • Install the packages xbindkeys and xautomation: sudo apt-get install xbindkeys xautomation

  • Save the following file as ~/.xbindkeysrc.scm :

      ; bind shift + vertical scroll to horizontal scroll events
      (xbindkey '(shift "b:4") "xte 'mouseclick 6'")
      (xbindkey '(shift "b:5") "xte 'mouseclick 7'")
    
  • Use your favourite mechanism to ensure that the xbindkeys command is run at the beginning of your xsession (I added it to ubuntu’s “startup items” preference, but you can surely use init.d if you’re comfortable with that).

Remap shift+space to underscore

So I had this great idea yesterday (for coders, at least): remap [shift+space] to [underscore]. Turns out I am far from the first to think of this, which only enforces its awesomeness as an idea.

Mac: Put this in ~/Library/KeyBindings/DefaultKeyBinding.dict:

{
	/* turn shift + space into underscore */
	"$ " = ("insertText:", "_");
}

Linux: for a PC keyboard, try:

xmodmap -e 'keycode 65 = space underscore'

or on a mac keyboard:

xmodmap -e 'keycode 57 = space underscore'

Or if neither of those work, run:

xmodmap -pk | grep space | awk '{print $1}'

and use that number instead of 65 or 57 above.

You can put this keybinding in ~/.xmodmaprc or somesuch if you like it.

A better snap-open (for gedit)

snap-open is handy. Unfortunately, it’s terribly crippled if you have a lot of files, since:

  • it uses the linux find command, instead of an index-based file list
  • it doesn’t run in a separate thread, so it locks up your entire GUI while it goes off to trawl your file heirarchy every time you change a letter in the find box

So I fixed it a bit. It is now threaded, and uses the linux locate command. This is still not ideal, it would be much better to use beagle. But I couldn’t figure out how to do that real quick, so locate it is (for now).

Update: As MadsBuus Points out in the comments, SnapOpen has improved a lot since then. Also, I’ve taken a similar plugin (gedit-openfiles) and turned it into a console-based file finder that allows you to open files with your preferred editor. Since I no longer use gedit, I think having a file finder independent of your editor is a pretty neat feature.