Wednesday, February 9, 2011

Multiple $PS1s with urxvt and xprop

Recently, I decided to embed terminals in my desktop and preferred that the prompt for them should be different than for a normal terminal window. It took a while but I finally achieved it. Embedding the terminals was easy as explained here:

https://wiki.archlinux.org/index.php/Openbox#Urxvt_in_the_background

and as for the different $PS1 prompts, I just modified my .bashrc with the following condition:

#BEGIN CODE#

winId=$(xprop -id $WINDOWID | grep "URxvtbg")

if [ "$winId" == "" ]
then
PS1="┌─\[\e[1;36m\][\u@\h]\[\e[m\].:\[\e[0;36m\][$(date +"%d/%m/%y-(%T)")]\[\e[m\]:.\[\e[1;36m\][\w]\[\e[m\]\n└─>>\[\e[1;32m\]$\[\e[m\]] "
else
PS1='[\u@\h \W]\$ '
fi

#END CODE#

Basically, what this does is that it gets the window information from xprop using the $WINDOWID bash variable and looks for the specific name* that was assigned to this terminal. If found, applies a specific $PS1 value and if not, applies the other.

*Refer urxvt's man page for the switch '-name'.

Sunday, February 6, 2011

Fortune for you!!

Almost all linux users are familiar with the fortune program. For new users, here is a small snippet:

Name:
fortune - print a random, hopefully interesting, adage

Description from the man page:
When fortune is run with no arguments it prints out a random epigram. Epigrams are divided into several categories.

Well, in order to fully utilize the program, I went ahead and wrote a small script that automatically displayed a random fortune everytime I logged in. Here is the script and all it requires is the notification daemon to be installed for your particular wm.

#!/bin/bash
sleep 3
notify-send "Hello $(whoami), Your Daily Fortune..." "$(fortune)"

Save it as fortune.sh and mark it as executable by:

chmod +x fortune.sh

and just add it to the post login scripts in your particular wm, openbox in my case so '~/.config/openbox/autostart.sh'

Dreamers and Artists of our time...

There were the greats of old such as Picaso, Rembrandt, Dali etc etc... but of our time in the digital age, they still exist. I would just like to direct people to such masters of our time. Their mind and work produce awe to the colorful earth around us. I salute to them as their work has inspired me and artists all over . Some of whom I know

Ryan Bliss : Digital Blasphemy
Greg Marting : Art Of Greg Martin
Gary Tonge : Vision Afar
Rudolf Herczog : Rochr
Bjørn Breivik : http://breivik.deviantart.com/

and many more...

Friday, June 11, 2010

Migration To Arch

Finally decided to switch to Arch Linux from Fedora. I really like the concept of rolling release vs point release systems and the idea of building the system from ground up. Also I wanted to try out Awesome WM but sadly Fedora didn't cut it due to lack of XCB support in Cairo which was available in the current Fedora Repos.

A short description from Wikipedia:

Arch Linux (or Arch) is a Linux distribution intended to be lightweight and simple. The design approach of the development team focuses on simplicity, elegance, code correctness and minimalism."Simplicity", according to Arch, is defined as "...without unnecessary additions, modifications, or complications.." and is defined from a developer standpoint, rather than a user standpoint.

Also with Arch I have made the push to 64 bit. Check it out:

http://www.archlinux.org/

http://en.wikipedia.org/wiki/Arch_Linux

And their Wiki is outstanding!

http://wiki.archlinux.org/index.php/Main_Page

Saturday, May 1, 2010