Main page







Other stuff





Check these out

My other sites

Mod Rocker

Middlerun abroad



Don't spam me



Tuesday, December 15, 2009

Hasta la vista, frozen app

I just came across an article, 6 Different Ways To End Unresponsive Programs In Linux. One of the methods caught my attention, the program xkill, which turns the mouse pointer into an app-killing cross of doom.

There's a cool effect in Compiz Fusion on Linux, where any window that is closed erupts in fire and burns up as it closes (it's part of the Animations Add-On plugin, more info here). When combined with xkill, it's pretty much like shooting the window. I decided to extend this by adding some shotgun sound effects. All it takes is a very simple shell script:


play /usr/local/share/xkillshot/gun_cock.wav &
play /usr/local/share/xkillshot/shotgun.wav

I call it xkillshot. When you run the script instead of running xkill directly, it first makes the shotgun pumping noise and arms the cursor. Then when you click the window the shotgun noise goes off and the program is killed.

The script goes somewhere in your $PATH such as /usr/local/bin and it requires the two files gun_cock.wav and shotgun.wav to be in the directory /usr/local/share/xkillshot and also seems to require the package sox, to enable the play command. Make sure the script and audio files have the right permissions. You can run it through a terminal or use Alt+F2, but for best results set a shortcut key. I used Ctrl+Alt+K. Any time Firefox or whatever freezes, I can just hit the shortcut to whip out the app-killing shotgun and blast it to pieces.

(I was going to make a video to demonstrate the awesomeness, but I can't seem to find a Linux video editor that doesn't suck balls. Pitivi had hardly any features, OpenShot has more features but as far as I can tell they mostly either don't work or cause the program to crash, Kino for some reason needs to convert the files into DV format which takes forever, Cinelerra is complicated and resource-heavy and Kdenlive is impossible to install. I have yet to try Open Movie Editor, but it hasn't been updated in nearly a year, not to mention it has a butt-fugly interface. I don't think I've tried LiVES either. But that's another blog post.)

EDIT: Here's an updated version of xkillshot which doesn't make the shotgun noise if you right click to cancel xkill.


play /usr/local/share/xkillshot/gun_cock.wav &
xkout=`xkill | wc -l`
if [ $xkout -ne 1 ]
play /usr/local/share/xkillshot/shotgun.wav

Be careful with this. As it says in the manpage, xkill is a dangerous program. It doesn't just close the window, it instantly kills the process which can cause you to lose unsaved data, so it can screw things up if you accidentally kill a process you shouldn't. I learned the hard way not to close a Nautilus window this way - Nautilus closed completely and all my desktop icons disappeared until I restarted X. But if Firefox freezes or something and you need to kill it, this is quicker than using the System Monitor and more fun than just using xkill on its own.



Post a Comment

Subscribe to Post Comments [Atom]

<< Home