Memoirs In Free Fall

March 26, 2005

Another piece of the puzzle

Filed under: Uncategorized — Tags: , , , — amit @ 9:31 pm

I’ve been hacking on Sawfish lately as I’ve blogged in the past. I’ve written another piece of the puzzle—window history support. I’ve written another module for Sawfish. This one provides an opacity submenu to choose the opacity level. Additionally, any settings made in this manner are recorded and recalled the next time a window is displayed with the same window class.

This means that I don’t need to set up an explicit matcher to set a window’s translucency, nor use transset manually; I can just hit the window ops menu and set the translucency that way.

March 22, 2005

More Sawfish hacks

Filed under: Uncategorized — Tags: , , , — amit @ 2:47 am

As I’ve mentioned earlier, I’ve been using Sawfish for translucency effects. I mentioned the translucent-move thing, but it had a drawback—if I have a window that already has an opacity property set, it’s set 100% opaque post-move, so I decided to hack up a little lisp to get it to base off the pre-existing opacity and restore it once done. It works quite well.

The objective was to eventually have the ability to set Sawfish to match windows based on window class or type (e.g. whether it’s a dock or dialog box or desktop file manager, etc.) and set an opacity level based on those things. Stock Sawfish does not incorporate the ability to match based on EWMH type or to manipulate opacity. Fortunately, as extensible as Sawfish is, its window matching module permits being extended to add matchers, properties to be manipulated and even supported types. So I took it upon myself to add support for such matching and manipulation.

Lo and behold, it works.

Match on window type, set opacity.

So now my dock windows are 85% opaque, as with KWin.

You might have noticed that I’m linking off the Sawfish wiki now. I’ve uploaded my extensions into the wiki. While doing this, I looked around and found an extension to incrementally select and switch to windows based on their names. This is sort of what I was thinking of doing over a year ago. This doesn’t tab-complete like a UNIX shell, it cycle completes like the Windows CMD shell instead, but it’s very effective and I’m enjoying it very much.

Suffice it to say that Sawfish has won me back. I might play around a little with KWin and its compositor, but Sawfish’s extensibility wins my favor.

March 15, 2005

KWin 3.4

Filed under: Uncategorized — Tags: , , , — amit @ 4:48 pm

So now I’m using KWin—KDE’s default window manager—as my window manager of choice. It appears to have some serious advantages over Sawfish in some ways:

  • Its window matching features extend to forcing a window to be a dock, for instance, and also allow for better integration through EWMH
  • The built in Composition Manager allows for fine-grained control, so for instance, the Universal Sidebar is automatically set translucent to 80% opacity without having to muck around with transset, and it’s less buggy too!
  • Built-in DCOP support in KHotkeys if I ever need it
  • Better themes available

I’ve even gotten my Quake Console working with KWin! I set up a few window matchers (leftmost icon on titlebar → Configure Window Behavior → Window-Specific Settings) for it. First, I set up a profile within konsole causing it to start without a menubar or tabbar (and with translucent colors), calling the profile QuakeConsole (and this name shows up in the titlebar). When setting up the matchers, I ensured that this title was matched.

Grabbing the window parameters
Selecting the Quake Konsole

Then I ensured that it’d be positioned without a border in the top-left corner, always on top.

Positioning the Quake Konsole
Styling the Quake Konsole

Now, to actually start the Quake Konsole, I added these lines to my .xsession:

konsole --profile ‘Quake Console’ --script --geometry 1024x360 &
QUAKECONSOLE=$!; export QUAKECONSOLE
(sleep 25; exec dcop konsole-${QUAKECONSOLE} ‘konsole-mainwindow#1’ hide) &

(The $! grabs the PID of the last process started, which in this case happens to be the konsole. The sleep’s in there to allow the DCOP server to start up, and the dcop call is what’s used to hide the Quake Konsole.)

Now, in order to actually let me toggle the Quake Konsole, I use KHotKeys to run a script that’ll determine whether or not the window is hidden. If it is, it’ll show it using a dcop call; if it isn’t, it’ll hide it. This demonstrates just a small part of the power of scriptability of objects via DCOP. (DCOP exposes an object model in KDE applications that bother to expose methods; those that do can be activated by other objects making DCOP calls. This isn’t dissimilar to what COM does on Windows.)

Here’s the script:

#!/bin/sh
HIDDEN=$(dcop konsole-${QUAKECONSOLE} ‘konsole-mainwindow#1’ hidden)
if [ ${HIDDEN-x} = x ]; then exit; fi
if [ ${HIDDEN} = true ]; then
        exec dcop konsole-${QUAKECONSOLE} ‘konsole-mainwindow#1’ show
else
        exec dcop konsole-${QUAKECONSOLE} ‘konsole-mainwindow#1’ hide
fi

The first dcop client call asks the konsole whether it’s hidden. If it is, it asks the konsole to show itself, otherwise to hide itself.

This script is activated by KHotKeys.

Run a command
Ye olde Alt-` please
Specify the toggle script

And in the end, the effect is as seamless as it was with sawfish.

I’ve also used the window matchers to do things such as turn off the taskbar buttons for gdeskcal, gkrellm and xmms, so that only windows that I’m bothered about show up.

I’m impressed how far KDE’s come these past few years, and I’m really interested to see what the project achieves with the 4.0 release.

Pure KDE 3.4!


Update:

I’m now back to Sawfish because KWin is exhibiting shading bugs when its compositor is turned on. Specifically, when shading a window, a rectangular portion of the window remains as ‘debris’ under the titlebar; this can be ‘wiped away’ by moving the titlebar up and down. Also, when unshading a window, the window remains invisible until it’s moved. Seemingly minor issues, but enough to make me go back to Sawfish until they’re resolved.

(Besides, Sawfish’s transparent move is pretty. :) )

March 14, 2005

KDE 3.4 preview

Filed under: Uncategorized — Tags: , — amit @ 6:17 am

I’m running the Alioth KDE 3.4.0 preview packages. I rebuilt (IA32-SSE binary) konsole 3.4.0 to enable Composite alpha blending. I really like it so far. There are a few nifty tooltip-transition effects and kdict integration, etc. that I find pretty neat. I’m still discovering new things about it, though—I tend to use desktop environments rather sparingly.

I ended up enabling the “Universal Sidebar” and setting it to autohide. Currently I’m using it as an RSS feed reader and a web search box. I might find new uses for it as time goes on.

I noticed that Konqueror is capable of prefix searches for filenames—rapidly type in the name of whatever you’re trying to select and it’ll do a prefix match. Type slower and it is only able to select the first letter. I hadn’t noticed that it’d already been implemented—this feature had been on my wishlist for a while.

Whoa, when did kpdf gain the ability to show bookmarks? Still, it chokes on the 400+ page documents that I typically reference. Adobe Reader 7 beta isn’t leaving my desktop any time soon.

Anyway, I feel that I’ve been underusing my DE resources, so I intend to try to get the most out of KDE when it isn’t more efficient to use the command line.

March 11, 2005

ADSL, finally

Filed under: Uncategorized — Tags: , , , , , — amit @ 6:24 am

After many tribulations, I finally have halfway-affordable ADSL at home. The provider is the government-run BSNL Bangalore Telecom District (in competition with the likes of ZeeNext. Bharti Telenet, Reliance Infocomm and Tata Indicom.

In India, broadband means something different compared to the rest of the world—it signifies “almost always on” rather than “large bandwidth”. For instance, the affordable offerings from BSNL (the cheapest provider at the higher end of the spectrum) top out at 1 Mbit/s, with most folks going for the cheapest option at 256 kbit/s. (This is what they’ve set my service up for, despite my explicit request for the 512 kbit/s offering, which has a more decent flat component—5 GB/month rather than 1 GB/month, with every megabyte beyond charged Re 1.50 for the 512 kbit/s option or Rs 2 for the 256 kbit/s option.) Most providers only provide IDSL (fancy ISDN) or “cable” (really Ethernet over coax) at 128 kbit/s (or worse, 64 kbit/s). Some of the wireless telephone service providers (notably Reliance and Tata) provide CDMA 2000 service at exorbitant rates and not-so-hot data rates of about 112 kbit/s. (Tata makes much of its business off the wireless Walky, which is essentially a mobile telephone in corded instrument form factor—for some odd reason it’s immensely popular.)

This is, however, “real” ADSL (albeit at an awful rate—currently at 256/64). It was surprisingly efficient for a government-provided service—about two weeks after registering for it (it is, after all, the government, so this is a near miracle), they got back to me and confirmed that I’d be home when the lineman came around. So today, he came and set up a DSL modem/router/firewall device, the Huawei SmartAX MT800 ADSL CPE. The forms said I could rent it for Rs 100 a month (with Rs 500 security deposit), but apparently in reality I didn’t have a choice and had to buy it for Rs 2,000. Fine, that isn’t so expensive. So for Rs 500 a month, I have PPPoA connectivity to the DSL modem (and PPPoE from the DSL modem to my computer). It’s attached via Ethernet to my box, so it was a cinch to get it running in Windows XP and Linux. It also incorporates a NAPT system with port forwarding and a packet-filter firewall (which suspiciously looks like a Web frontend to netfilter—Huawei’s known to build their devices around Linux); I’ve set my computer in the DMZ for the moment (of course with a netfilter firewall started up as part of the ip-up.d scripts), but I’ll tweak the rules a bit later.

Setting up PPPoE in Debian was pretty easy, by the way. I already had a dialer (GKDial, which sits in the KDE or GNOME system notification area, and which I’m trying to replace, since it loves to crash X and doesn’t seem to be able to monitor the connection) and pppd set up for my 56k modem, and apt-get install pppoe added a few files—the Roaring Penguin PPPoE stack and a couple of hookup scripts to let pppd complete authentication and stuff. I had to modify /etc/ppp/peers/dsl-provider to provide the log-in username and /etc/ppp/chap-secrets to provide the password. (BSNL, contrary to convention, decided to go with CHAP rather than PAP. Oh well.) After this, all I needed to do was to restart GKDial and set the DataONE ADSL connection as the default connection and dial out. :)

I ended up signing up for one of those free dynamic-IP subdomain hosts and utilizing ifconfig to figure out the IP address; the script to tie all of this together went into /etc/ppp/ip-up.d, so now every time I connect (with a different IP address, I might add), the hostname is updated. Disturbingly, it seems to be set with a TTL of an hour, which might be too long, but oh well.

Anyway, it’s a relief not to have to wait as long for pages and content to load as I needed to on dialup. Hopefully getting my service upgraded even further won’t be as much of a hassle as, say, getting my telephone line shifted here was.

Happy birthday, Jorge.

GNOME 2.10 was released. I’ll try it when there are experimental debs for it. (No, Jorge, I am not switching to any flavor of Ubuntu.)

March 9, 2005

PaX commits seppuku

Filed under: Uncategorized — Tags: , — amit @ 2:54 am

I just read that PaX, Linux’s version of OpenBSD’s W^X and Windows XP SP2’s DEP, has a vulnerability that allows privilege escalation—pretty damning for something that’s supposed to dramatically improve security, cutting down the possibility of egregious buffer overflows.

This is a spectacular [mess]up, it pretty much destroys what PaX has
always stood and been trusted for. For this and other reasons, PaX
will be terminated on 1st April, 2005, a fitting date… Brad Spengler
offered to take it up but if you’re interested in helping as well,
contact pageexec freemail hu

I thought the ironic turn of events (security patches introducing egregious security problems) was interesting, but I’m sad to see PaX go—hopefully the project won’t die the fiery death its maintainer intends.

March 6, 2005

More transparency goodness

Filed under: Uncategorized — Tags: , , — amit @ 7:10 pm

So after weeks of using Keith Packard’s transparent xterm, I grew tired of bugs that render the xterms nearly unusable, with streaking effects when I scroll up:

Streaking effects

and ghosting when the application updates:

Ghosting effects

(The screenshots were captured opaque to highlight the issues; they exist with transparency too.)

Enter transparent Konsole. Debian’s KDE 3.3 packages do not enable transparency for Konsole (presumably because Debian’s X packages don’t support Composite), so I ended up rebuilding the konsole package (along with the rest of kdebase) with CFLAGS and CXXFLAGS set to -DCOMPOSITE. Transparent konsole behaves itself:

Transparent konsole

Hoary users and Debian sid users using X.org 6.8.x (from hoary or otherwise deployed) can grab my konsole package. Jorge says it works fine for him. Warning: You’ll need a Pentium III or Athlon XP or higher to use them, since they’re built with SSE floating ops. (You’ll need to run a composition manager to get the transparency effects.)

March 4, 2005

PSA: It’s the end of the world as we know it.

Filed under: Uncategorized — Tags: , — amit @ 10:45 am

Programmers, read what Herb Sutter has to say about hitting the clockspeed wall, and multithread your CPU-bound code.

The Free Lunch Is Over: A Fundamental Turn toward Concurrency in Software

Blog at WordPress.com.