Posts Tagged ‘Battlestar Galactica’

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.

Random thoughts of a sleep-deprived mind…

Monday, January 28th, 2008

Couldn’t sleep last night, went to bed around 0100 hours (a little late, but I figured I’d manage with 5 hours worth of sleep, as I always try to trick myself) and just tossed and turned until I finally gave up trying to sleep around 0200, and sat down in front of the computer again, watched a movie… or two… while researching some on Lisp and Perl.

This continued until about 0500 when I finally started to feel so sleepy that I surely couldn’t stay awake even if I wanted to (which I didn’t). Oh how wrong I was. A quarter to six I was beginning to drift out of consciousness and into dreamland, but then I realized the futility and just lay there awaiting the alarm from my cellphone.

Great way to start a new day… really… not. So now I’m in school feeling pretty shitty, tired, queasy and freezing. So why would I want to share with you any thought currently in my mind? Good question, I sure as frack don’t have an answer (btw, may the Lords of Cobol make the writers strike end soon so that we can have season 4), but for what it’s worth (probably not much) here goes:

On a more serious note (not that Python, Perl, Erlang, Firefox, sshfs and rsync isn’t serious business) it gladdens my heart to see that more and more governments around the world are embracing the Open Document Format. Hopefully this more than anything will put an end to the madness that is Microsoft OOXML.

Over and out