Posts Tagged ‘Compiz’

Galactifying my desktop

Saturday, May 16th, 2009

I stumbled across a blog post today which described how to “insert” a terminal onto your Compiz desktop. Naturally I became all giddy over the idea since all these tv-shows, which present computers where the desktop is alive with various kinds of fictional data which flow by, has totally corrupted me, so I got to work setting it up per the instructions.

My previous wallpaper (white and black, and various shades of gray) didn’t make font-color selection easy, which ended up with me replacing the old wallpaper, with the beautiful Tricia Helfer (wallpaper).

Which got me thinking further, that I could do something funny with this terminal, and since my desktop was already taking on a strong feel of Battlestar Galactica (well, number six at least) I could have the terminal reinforce that feeling.

So, terminal font-color: red. Then I had another thought. Inside the .bashrc configuration file there is a small snippet of code which sets the PS1 variable to various things. Pontus has modified his, and helped me modify my, PS1 variable so that each terminal prompt now reads:

[username] [pwd]

Therefore it shouldn’t be that hard for me to modify it to look for this particular terminal-instance and output an altogether different prompt, say along the lines of:

By your command

This turned out to be a rather hard nut to crack actually. I figured I could write a shell script which would launch the terminal, with a correct set of parameters, and one of these parameters, in turn, would be another shell script to execute upon creation of the terminal window. The first shell script could then be called upon by the session manager at login.

That was the theory anyway. Actually getting it to perform all these things was less than easy. The shell script to be executed by the terminal wouldn’t conform (although this might have been my own ignorance putting a stop to it).

I won’t drag on about all the various ways I tried to fix this, in the end Pontus arrived and saved the day ;D

His solution: create a clone of the .bashrc file, change the PS1 variable modification in it to whatever I wanted (“By your command”), then have the session manager execute the following command:

gnome-terminal --window-with-profile=trans -x bash --rcfile ~/.nrsixrc

(where .nrsixrc is the cloned .bashrc file, containing the modified PS1 variable)

For interested parties, the interesting line in .nrsixrc is this one:

PS1='\nBy your command\n> '

And here’s the result:

by_your_command1 Oi! Stop ogling the b00bies and focus your attention at the upper left corner! I don’t know about you, but I find it pretty neat.

The one thing I have a hard time figuring out however, is why the terminal won’t either die, or recover, if I by accident forget myself and try to close that terminal. It will just “hang” and my two options at that time is to either use xkill (which coincidentally will also kill the terminal with which I initialize xkill) or do a killall gnome-terminal. None of these alternatives are especially attractive, and I can for the live of me not figure out why that is. But for the time being it will do just fine.

Check off another annoyance

Saturday, March 28th, 2009

My stationary computer, running Gutsy Gibbon, had since the very beginning had one really annoying oddity going on. Namely that after having pressed the “log off” icon, it would take anywhere from 30 seconds up to 2 minutes until the actual log off dialog, with all the options, would appear.

Having done it once, and chosen cancel instead of logout / whatever, the window would appear within a blink of an eye the next time the log off icon was pressed. Up until this morning I have been lazily just popped up a terminal and entered “sudo shutdown -h now” which works as intended, but this morning was different. It might perhaps be that I am dragging my feet about going to bed, but in any case, my first attempts with Google failed :/

I had a sneaking suspicion that it had something to do with Compiz (since disabling the desktop effects returns control to Gnome and everything works as intended again), so I persisted in my searches. And found this bug report. Now I wasn’t about to change the user and move all my stuff just for this bug, but the last entry, informing that re-enabling power-management in the session should solve the problem, seemed like a more than reasonable thing to try in my (self-inflicted) sleep-deprived state.

Entering the session control I quickly noticed that the power management was indeed disabled, so I enabled it, logged out and logged in again. And as if at the flick of a switch, the logout-dialog appeared instantaneously.