The Underground - Kevin Lange The Compiz-Fusion Digest Edition http://blog.phpwnage.com/ My New Bash Prompt Thu, 04 Feb 2010 14:31:26 EST http://blog.phpwnage.com/article.php?id=123 forum image

In a normal prompt, it's pretty much the same as my old one: user, host, date, time. I added a seconds display, moved the path into the brackets, and then added a new line. When in a git repo, I can see the current branch name, whether I have modified files lying around, and whether I have yet to push (if I'm ahead of the current branch). I'm thinking of expanding this to subversion and Bazaar, both of which I use quite a bit. When a program returns a value other than 0, I also display that after the current time, in bright red. If I'm root, the prompt symbol changes from a green $ to a red #.

The more interesting things to note are why I have so much information there by default. I ssh to a lot of different machines and sometimes into different users, so it's good to be able to identify what user I currently am (whether it be `klange` on my personal systems, `lange7` on a university system, or any of the random users I `sudo --` into on my server). For the same reason, I always need to know immediately what machine I'm connected to, but I don't need the full hostname (I know what machines are part of the ACM network and which are part of EWS, and which are mine, based on naming schemes). I use the clock because my panel is on auto-hide, so the quickest way to glance at the time is to look at the prompt, rather than having to move my mouse to show my panel. It's also good to see when a command ended.

Code:
function prompt_command {
    local RETURN_CODE="$?"
    local ASCII_RESET="\[\e[0m\]"
    local ASCII_BOLD="\[\e[1m\]"
    local USER_COLOR="\[\e[1;33m\]"
    local PROMPT_COLOR="\[\e[1;32m\]"
    if [[ ${EUID} == 0 ]] ; then
        PROMPT_COLOR="\[\e[1;31m\]"
    fi
    local HOST_COLOR="\[\e[1;32m\]"
    local DATE_COLOR="\[\e[1;31m\]"
    local TIME_COLOR="\[\e[1;34m\]"
    local DATE_STRING="\$(date +%m/%d)"
    local TIME_STRING="\$(date +%H:%M:%S)"
    local CYAN_COLOR="\[\e[1;36m\]"
    local PINK_COLOR="\[\e[1;35m\]"
    
    local PROMPT_PREFIX="$PROMPT_COLOR"
    if [[ $RETURN_CODE != 0 ]] ; then
        PROMPT_PREFIX="$DATE_COLOR$RETURN_CODE$ASCII_RESET " # do nothing
    fi
    local GIT_STATUS=`git status 2>/dev/null`
    if [[ $GIT_STATUS != "" ]] ; then
        local REFS=$(git symbolic-ref HEAD 2>/dev/null)
        REFS="${REFS#refs/heads/}"
        if [[ `echo $GIT_STATUS | grep "modified:"` != "" ]] ; then
            REFS="$REFS$ASCII_RESET ${PINK_COLOR}modified"
        fi
        if [[ `echo $GIT_STATUS | grep "ahead of"` != "" ]] ; then
            REFS="$REFS$ASCII_RESET ${CYAN_COLOR}not pushed"
        fi 
        PROMPT_PREFIX="$PROMPT_PREFIX$USER_COLOR$REFS$ASCII_RESET "
    fi
    
    
    PS1="$ASCII_BOLD[$USER_COLOR\u $HOST_COLOR\h $DATE_COLOR$DATE_STRING $TIME_COLOR$TIME_STRING $PROMPT_PREFIX$ASCII_RESET\w$ASCII_BOLD]$ASCII_RESET\n$PROMPT_COLOR\\\$$ASCII_RESET "
}
export PROMPT_COMMAND=prompt_command



Discuss this news post here.
(No comments)]]>
Reddit AMA? Sat, 30 Jan 2010 02:50:12 EST http://blog.phpwnage.com/article.php?id=121
If we do, we'll be using the account IAmACompizDev.

Just an idea though.


Discuss this news post here.
(No comments)]]>
Been a While - Yet More Compiz Headtracking Fri, 22 Jan 2010 21:41:17 EST http://blog.phpwnage.com/article.php?id=120


(If you are coming from the Compiz Planet, please click the Discuss link down below to see the videos)

Specs are in the video description.
I'm going to try to clean everything up and do a more professional video when I get it in top-notch shape, but the basics are working. I've also discovered that it looks terrible with two displays, so I've got some tweaking to do to fix that.

e: I see I've been reddit'd. Yes, I'm the `klange` posting in the comments. I guess a better explanation is in order!
All of the tracking seen here is done with a webcam video feed. OpenCV (Intel's computer vision library) detects the location of my face in the webcam feed using HAAR detection. This then gets run through some trig to get the final location of the head. The current code base does not detect distance to face, so it's not perfect (this is why I'm picking up the code again). The hardware I used isn't special in anyway. Any laptop with a webcam can do this - the original videos we have from a year ago were recorded on a Dell netbook with a 1.3MP camera. There is no head-attached tracking hardware, it just detects your face (specifically, your eyes).

e: And since someone always ends up asking, the code is right here. The update I just made recently removes depth-perception, primarily because it didn't work with the code I was using. I'll add it back in once it's working again.


Discuss this news post here.
(No comments)]]>
Look familiar? Thu, 17 Dec 2009 12:14:14 EST http://blog.phpwnage.com/article.php?id=116

e: Someone posted this on the Ubuntu Forums, and I finally found it and responded. Here's an excerpt from said reply that will hopefully shed a bit more light on what happened here:

Where do we begin... I guess I'll give an overview of the real story:
Back in December of 2007 I saw the famed Wii Remote head-tracking video by Johnny Lee. It was awesome, and I popped into #compiz-dev as I usually did back then and said "I'm porting this to Compiz". I didn't have a wii remote at the time, but SmSpillaz (Sam, a fellow Compiz developer, and now one of the head guys for community management two years later) did, so I wrote up the code, which took a few weeks of poking around with other plugins. This was my first functional plugin for Compiz. Eventually, we got it working and SmSpillaz recorded what is one of the worst video demos ever. This is all in January-February of 2008. A few months later, Apple files this patent. Two months after that, with the help of a forum-goer / programmer, we had it ported to a webcam with OpenCV using the OpenCV facetracking demo. It worked great, and we have videos of it in action, clearly doing its job. Eventually, I got a system with a webcam (yeah, finally, I can use my own plugin!) and recorded the last video we ever took of the thing, and that was it. It's been idle since February of this year. Eventually I moved to another (completely unrelated) community and my Compiz work was a good conversation piece. A few days / weeks before the patent went public, one of my friends on this community was rather obsessed with my work (...), and the day before this news release came out I took the time to get everything squared away to continue work and try and get my tutorials fixed up so they could actually use it. I did a git-pull that night. Now, like any other Internet denizen, I read a lot of Gizmodo / Engadget / what have you, and as with any other morning I made the rounds. And found this news article. And I got pissed. You see, I'm mildly bi-polar, and I'm a bit cranky in the morning to begin with, so this definitely isn't helpful. The blog post the OP linked was what resulted from an entire day of link hunting, after blowing off steam at a chemistry final (which I got a B on, and this probably didn't help that, but you won't see me contacting my college about it any time soon).


Well... That looks... oddly familiar. I could swear I've seen this before.

The patent was filed in June of 2008, while the last commits to our original prototype were made on "2008-02-11" (that's February 11th in this date scheme) ~ We have videos from the same year of the Wiimote prototype. The entire thing was working on a Wiimote in January of '08. I do believe I win for prior art (though the webcam-enabled version wasn't out until seven months later, two months after the patent). More specific window-stacking video from September of '08. And more importantly this video from February of '08 proves our prior art.

The article on MacRumours.

e: After reading and verifying, the way the patent describes the "sensing mechanism" leaves it open to the infrared camera and light setup of the Wii remote, so our original plugin should fully suffice, and we have video footage of it in action long before Apple filed the patent.


Discuss this news post here.
(No comments)]]>
Ping? Sun, 27 Sep 2009 03:16:49 EDT http://blog.phpwnage.com/article.php?id=103 *poke*


Discuss this news post here.
(2 comments)]]>
So I'm sitting in the Siebel Center... Sun, 23 Aug 2009 20:31:39 EDT http://blog.phpwnage.com/article.php?id=87 Michael Lynn, who is going back to college to get a degree so he can later become a professor. "Apparently they want you to have a degree for that.."

I've changed the picture on his Wikipedia page. We'll see how long it lasts. [;)]


Discuss this news post here.
(No comments)]]>
ATTN: Compiz People Wed, 05 Aug 2009 16:55:04 EDT http://blog.phpwnage.com/article.php?id=86
Hi guys! It's been a while.

You're not dead yet, are you?


Discuss this news post here.
(2 comments)]]>
Maybe it's time... Sat, 04 Apr 2009 15:44:21 EDT http://blog.phpwnage.com/article.php?id=62 So, I figure it's time we look a bit bigger. As 0.9.0 starts to build back to the status of 0.8.* in plugins, we should look at things we need to build a solid, effect-filled DE. Sam mentioned the possibility of forking GNOME, but do we really want to go that route? I can see the backend systems in GNOME being reused in the "CompDE", but I don't see us forking their panel and desktop: we don't need to. Compiz has always been an add-on to existing DEs, and we need to consider that: We can build the basics, we already have. We have numerous panels, and we're working on a deskop. The rest is integration systems.

Hm. I'm limited on time here, so I need to wrap it up. I'll try and make a more suitable argument later when I have time.


Discuss this news post here.
(2 comments)]]>
New Mesa Fixes UXA/DRI2 Transparency Issues [Ubuntu] Fri, 03 Apr 2009 08:18:20 EDT http://blog.phpwnage.com/article.php?id=61 Jaunty just got a new package of Mesa 7.4, and it fixes a long-standing bug in DRI2/UXA (it was there back before UXA was even impelemented) where transparent windows that didn't already set a suitable RGBA colormap appeared corrupt because they had overvalued pixels (so stuff appeared white when it shouldn't have).  It's finally been fixed!
I'm sure there were other things fixed and updated in this release, too, but I don't actually know what they are, so I can't talk about them.


Discuss this news post here.
(4 comments)]]>
Compiz Webcam Head Tracking Mon, 09 Mar 2009 17:13:12 EDT http://blog.phpwnage.com/article.php?id=44
So, you want to install the HeadTracking plugin for Compiz, 'eh? Well, then, you'll want to follow this guide to keep out of trouble.

Update: This commit should work.

So what do I need?
- This commit of OpenCV
- All Compiz -dev packages (compiz-dev, compiz-fusion-dev, compiz-bcop - whatever applies)
- Any required dependencies for OpenCV (I do not have a list, if you encounter a missing library when compiling, post a comment here and I will start making a list)
- All Compiz -dev packages (compiz-dev, compiz-fusion-dev, compiz-bcop - whatever applies)
- The plugin itself (which has been adjusted for this particular commit of OpenCV - if you get an error with retrieveFrame because you have a newer OpenCV, please use this)
- All Compiz -dev packages (compiz-dev, compiz-fusion-dev, compiz-bcop - whatever applies)
- A camera that works with OpenCV (please check the list if you are having issues after compiling)
- Did I mention you need the Compiz -dev packages and compiz-bcop/compiz-fusion-bcop?

Compiling...
So now we can compile: first build OpenCV:
Code:
./configure
make && sudo make install

If you have any issues, post them as comments here - be sure to grab on dependencies you are missing and post them here.
When OpenCV is done (it may take quite some time), ensure your environment is ready to build Compiz plugins (this shouldn't take any extra work).
Then compile the plugin:
Code:
make && make install

If you have issues here and the error messages do not say "facedetect.c" or something to that effect, you probably missed a Compiz -dev package. Check your distribution's documentation for any extra information on compiling Compiz plugins, or see the Compiz Wiki.

Configuring...
If you've reached this point, you're ready to configure the plugin. This takes quite a bit of trial-and-error to get things to look smooth. The biggest suggestion I can make is to increase the width and field-of-view options - their defaults are way too low. If your display appears corrupt, it's probably because the camera is set to point extremely far away or extremely close: if the display appears flipped, it's probably too close. If the display is corrupt or doesn't seem to update, it's probably too far away. Adjust the width and see if it helps. If no set of values seems to work, you can contact me and we can do some debugging to find appropriate settings for your camera.

But I'm still having problems!
Please, post your issues here - don't post on other forums, as if there's a topic for "Headtracking", solving issue is probably not its purpose.


Discuss this news post here.
(20 comments)]]>
Compiz 0.8.0 Out - Transition Begins Fri, 20 Feb 2009 14:23:52 EST http://blog.phpwnage.com/article.php?id=39
Short post is short.


Discuss this news post here.
(11 comments)]]>
GEM/DRI2 Shaping Up in Ubuntu Jaunty Fri, 06 Feb 2009 20:13:56 EST http://blog.phpwnage.com/article.php?id=35
forum image

And here's the video - ignore the poor performance, obviously I'm using a screen recorder.

Obviously, it still has that classic colormap transparency bug (which was there in the original DRI2 a year ago), but it works nicely with barely any crashing. It's also just as speedy as, if not faster than, EXA. Scrolling in Firefox is great!

Here are some more UXA transparency bug pics:
Firefox (with opacity -1)
Firefox (on cube, normally)
CCSM (view this on a non-white background for a cool side-effect!)


Discuss this news post here.
(2 comments)]]>
Compiz is Dead, Long Live Compiz! Wed, 04 Feb 2009 13:00:32 EST http://blog.phpwnage.com/article.php?id=34
All glory to the compositor!
[/religion]

So, yes, yesterday was the Compiz Conference Call. I'm not nearly important or influential enough, nor was I even able to be there, but it happened and everyone pretty much agreed that the current "C" Compiz should be scrapped, Compiz++ "merged" (isn't more of a replacement?), and that soon after Nomad would be merged. Compiz-Fusion is no more - all of the "community" plugins are going to be some sort of unsupported or alternate set (this really started happening when Plane was dropped, I guess). The -Fusion name is pretty much being dropped, as is the idea of Compiz++, it's all just Compiz - the new Compiz. Forums and wikis and bug trackers will be moved to compiz.org, and things will continue.

This is all good - but I have to get to work, first with re-learning C++ and second with porting the Headtracking plugin.
Hopefully we can get SpringDesk to be an integral part of the neo-Compiz, too.

e: This article was originally posted on 2/3/09, so "yesterday" refers to 2/2/09, as noted above by the religious-seeming statements.

Discuss this news post here.
(5 comments)]]>
More Compiz Webcam Headtracking Tue, 03 Feb 2009 18:58:10 EST http://blog.phpwnage.com/article.php?id=33

forum image

Digg

Yet more Compiz Headtracking!

The new video is up. It shows the same view as the last video for around 5 seconds, then shows some nice cube rotation and window stacking. It's a bit more smooth here (especially the cube rotation, which, not to brag, looks phenomenal!). Check it out, comment, show your friends. Let's get this one on the first page of Science and Tech!

Also, slashdot, digging, etc. are all acceptable forms of flattery.


Discuss this news post here.
(8 comments)]]>
Compiz Webcam Headtracking Sun, 01 Feb 2009 00:23:52 EST http://blog.phpwnage.com/article.php?id=31

(Planet readers, click here)
forum image


Quite a bit of work went into making this, but I'll keep this post short. I wrote the original headtracking plugin a while back to use a Wiimote (and we still have some limited support for one). About a year ago, another developer extended it to use webcam tracking via OpenCV. It still had some bugs and no one really touched it for quite a bit of time. Until now. I made a number of big changes to the code to make things smoother and faster, and more configurable, and it works great with my Mini.

Basically, we're taking data from the camera, piping it through OpenCV to do facetracking (which is taken directly from the sample application provided with OpenCV), pushing that data back into Compiz, doing some trig on it to find a 3d position for our face, and then warping Compiz's OpenGL viewport with glFrustrum. The end result is a rather nice 3d desktop that actually works. We also make windows stack based on their z-depth, so we can look behind them. There are a number of bugs and the thing is still very glitchy, but it works well enough to be somewhat useful. Hopefully we'll get a few more things fixed up later on.


Discuss this news post here.
(15 comments)]]>
Ubuntu Ohio Tue, 13 Jan 2009 21:15:58 EST http://blog.phpwnage.com/article.php?id=26
I don't post pictures of myself, so I've GIMP'd a nice big black oval over my face.
1. Get Ubuntu, get a webcam and get cheese
2. Create a sign (which LoCo you’re from)
3. Blog
Taken on my Mini.


Discuss this news post here.
(4 comments)]]>
Compiz is Dying and we Need to Fix It Fri, 02 Jan 2009 11:29:12 EST http://blog.phpwnage.com/article.php?id=22 on the mailing list recently, and while the Phoronix article may be a little out of place, what he said may very well spell an end for Compiz if we don't do something about it.

Basically, what Kristian is saying is that Compiz lacks direction: We don't have a set plan on where we're going with the code. Every so often we add a new plugin, or change the core to fix a bug, but there is no over-arching theme to what we're doing. Then someone comes along with something like the object framework or Compiz++ and we just don't know what to do with it.

Kristian also mentioned the poor quality of the documentation on the core. It's out-dated, poorly written, and no one contributes to it except himself. If Compiz did die, it would be pretty hard for another group to pick it up without a properly documented core, so we're just screwing everyone over if we don't work on this.

One last thing Kristian said was that we're fragmented. Code is kept in two places, as are bugs and mailing lists. We need to consolidate. I for one believe our best bet is to just take the C-F ML, bug tracker and git and use them. They already have more than the Freedestkop pieces because they carry all of the Compiz-Fusion work. Personally, I think we need to drop the idea of Compiz + Compiz-Fusion, and just let it all be one again. But that's probably just me.

Anyway, Compiz isn't dead yet. Far from it. We have new plugin devs, great plans for the core, and a lot of potential direction. We just need some agreement on where we should go.


Discuss this news post here.
(29 comments)]]>
The Future of Your Desktop Tue, 04 Nov 2008 15:14:44 EST http://blog.phpwnage.com/article.php?id=13
Let's get something out of the way first: This is a brief article I'm writing because I'm bored and want to spill my opinions and vision on the future of such things as GEM and DRI2, Plymouth, "graphical login for GDM", input redirection, and XInput2 - amazing open-source technology that are all happening right now.

Independently, these aren't as big and important as you may think:
Plymouth gives a pretty boot - who cares? XInput2 means I can use multiple mice, but that doesn't matter if my window manager doesn't care about them. DRI2 has amazingly been left untouched outside of the developers - yet the difference the framework makes for Intel graphics users is amazing. Input Redirection has no effect on a normal user unless they're using a patched Compiz.

But, let's throw these together, shall we?
Mix a pretty boot with proper mode setting and we get instant transitions from our boot splash to our login. Graphical login means, at the very least, fading from the prompt to the desktop. GEM and DRI2 mean compositing really can be a default in even the most conservative of distros, and means that running Compiz will be even smoother. Input redirection means Freewins and other such plugins for Compiz have a purpose - you can now rotate windows around, and even move them in 3d space. And Compiz has MPX support, too, so you can use two mice to resize windows, and all those other cool things.

Yet, Input Redirection isn't going anywhere in X. It's been ignored for quite a while, and only a few months ago was it revived and put to use in Compiz. But will these patches ever make it into X? Probably not. There goes one piece of innovation.

XInput2, thankfully, is part of X already. But it was delayed an entire release!

DRI2 was scrapped twice, once for general use, then for inclusion in X. Luckily, it's now back and better than before. If anyone can find a GEM/DRI2 video that isn't from the old version, I'd be much obliged to see it.

Plymouth is being fought by the fools who think we'll be seeing 5 second boot ups on old Pentium 4s in the next year, which is ridiculous to say the least.

Ahh, well, at least we're getting a number of new innovations in the coming months...

[/random]


Discuss this news post here.
(5 comments)]]>
Compiz and Python, the perfect couple? Thu, 30 Oct 2008 22:31:19 EDT http://blog.phpwnage.com/article.php?id=11 There was an idea long before my time to have Compiz (or rather Beryl, I do believe) have smaller plugins powered by an integrated Python interpreter. This is a very simple concept [e: I'm referring to the concept here, not the actual work of binding Python and Compiz] considering how easy it is to integrate Python into a C app: So easy, I was going to write a Python plugin for Pidgin to power my IM service, but the library didn't compile correctly (still working on that). In Compiz, we wouldn't be making very big demands to the plugin itself, rather it would do smaller tasks, and not every frame. There'd need to be a lot of bindings to all sorts of Compiz items, as well as OpenGL functions that can be executed in Compiz's scope.

Anyway, just food for thought if anyone is interested.


Discuss this news post here.
(5 comments)]]>
Back From OLF Sat, 11 Oct 2008 22:51:33 EDT http://blog.phpwnage.com/article.php?id=6

Well, I'm back home in Strongsville after quite a day at Ohio LinuxFest! Got there around 11:30 with my friend Alex and we spent some time at the Ubuntu booth. Had to wait for Jacob to come over so I could get a shirt (thanks, Jacob!) then we headed out for lunch in the food court, where I was actually able to find a wireless network with Internet access.

Anyway, after eating lunch, we headed over to the Roland Hess's speech on Blender, which was really informative and enjoyable. They were playing Big Buck Bunny when we got there (just to play it, though, as it was also showing in a much better viewing environment over in the HP Movie Theater, though we never went over there). He talked a lot about the business model that worked behind the scenes to support Blender. After that we went to maco's thing on wireless security, which honestly wasn't as good as it could have been. The last thing on our list was the Python workshop, which I personally wanted to see because I have to give a crash course in Python to a number of my peers in two weeks. We stuck around to watch some guys mess around with sqlite and then headed off for the "Evening Thank You" and Jono Bacon's keynote address.

Unfortunately, we never got our surveys in, so we we're even in the drawing for the HP laptops, but Jono's speech was spectacular!
All in all, I came away from the event with a brand new Ubuntu shirt, a copy of "The Official Ubuntu Book" signed by Jono (now I just need Benjamin Hill, Corey Burger, and Jonathan Jesse...), and a "powered by ubuntu" little sticker thing.

Well, that's it, I'm about to fall asleep right here, so, one more picture before I go:

forum image


Discuss this news post here.
(No comments)]]>
RSS Test Thu, 09 Oct 2008 18:51:56 EDT http://blog.phpwnage.com/article.php?id=4

Discuss this news post here.
(3 comments)]]>