Archive for December, 2008

Amarok-Music Tracker for pidgin

There is a music tracker plugin that comes along with the pidgin 30 plugins.. but that doesn’t work good for me and i use only amarok for music. So i decided to write myself a music tracker.
A file in .purple/status.track in the home folder is used to keep track of the available and away status.
This one needs to be started explicity with the pidgin.

Here is the code:

pstatus=`cat $HOME/.purple/status.track`
title=$(dcop amarok player title)
title=`echo $title|cut -d'-' -f1`
album=$(dcop amarok player album)
album=`echo $album|cut -d'-' -f1`
purple-remote "setstatus?status=$pstatus&message=Amarok Now Playing: $title : $album"
while [ TRUE ]; do
pstatusn=`cat $HOME/.purple/status.track`
if [ "$pstatusn" != "$pstatus" ]
then
purple-remote "setstatus?status=$pstatusn&message=Amarok Now Playing: $title : $album"
pstatus=$pstatusn
fi
newtitle=$(dcop amarok player title)
stat=$(dcop amarok player isPlaying)
newtitle=`echo $newtitle|cut -d'-' -f1`
if [ "$stat" = true ]
then
if [ "$title" != "$newtitle" ]
then
album=$(dcop amarok player album)
album=`echo $album|cut -d'-' -f1`\
newtitle=$(dcop amarok player title)
newtitle=`echo $newtitle|cut -d'-' -f1`
purple-remote "setstatus?status=$pstatus&message=Amarok Now Playing: $newtitle : $album"
title=$newtitle
fi
elif [ "$stat" = false ]
then
purple-remote "setstatus?status=$pstatus&message=Amarok Now Playing: Amarok Paused"
fi
done

You can also append a message with the music name if you want by editing the script at the purple-remote command lines

6 comments December 30, 2008

Coding gets simple

Yeah.. Coding gets simple with the amazing language ruby.. my new love..
Thanks to Yukihiro Matsumoto for creating it and Titty sir (My project guide at college) to introducing me to it.
Sounds like an affair? :P

For me who often forget syntaxes this one is an awesome one..

10.times do |x|
puts x

end
It is tat simple counting..

"string".reverse

it is tat simple string reversing..

Ruby on rails is an amazing platform and to mention that many famous sites including twitter, yellow pages, ilike run on RoR. This is a part i yet have to look into..

I had decided to study this amazing lang for my mini prjct which is currently in the oven. Will update soon with the crazy project soon in here.. :D

irb aka interactive ruby is a really amazing thing. It is kinda a testing env for your ruby codes.. just like a command prompt you can issue your ruby commands and test them before putting it to a full code. I really wish other compliers and interpreters also have something similar.
Here is an online irb for testing.. though it din obey one of my small codes.. it works good for an online version.

Ahh forgot to mention tat this one is a multi-paradigm language..

To install it on ubuntu..
$ apt-get install ruby irb

Never so a language with such a readability.. I guess this is one language that will never be 100% obfuscatated.

Add comment December 24, 2008

Anniversary Post

Ahh.. actually there is nothing to post.. this is just a post to mark 1year of this blog..

Add comment December 20, 2008

Finally stickers for the laptop..

I got a laptop from my aunt in US in the begining of november.. But since the university exams were going on i never had time to really juice it..
Here is the config of the laptop:
* 15.4″-diagonal widescreen WXGA (1280 x 800) UltraBright™ LCD screen
* Intel Core 2 Duo processor T5750 operating at 2.0GHz 2MB L2 cache
* 3GB of PC2-5300 DDR2 SDRAM memory (2GB + 1GB)
* 160GB 5400-rpm Serial ATA (SATA) hard drive
* Multiformat DVD drive with Double Layer support (reads/writes DVD±R/RW, DVD-RAM, DVD±R Double Layer, CD-R/RW);    supports disc labeling on Labelflash media
* Intel Pro/Wireless 3945ABG (802.11a/b/g) wireless LAN
* Integrated 1.3-megapixel webcam, for live video chat and still photos
* 5-in-1 memory card reader: reads SD, MMC, xD, Memory Stick, Memory Stick Pro
* Intel Graphics Media Accelerator X3100 with up to 384MB shared memory

And finally when it is over the MACS group decided to conduct a fossmeet at our coll. And during this early organising stage we had a small fun of test printing stickers for the meet. And we had a wonderful result..
Here are some of the stickers i used from the sticker book we designed.
Almost all the stickers are taken from the free software sticker book.
Sarath (Slynux Guy) has designed 2 of them.. and one from a wallpaper that i found long time back..
Powered by ubuntu sticker is from system76
Here are some pics of stickers i used..

dscf2091

dscf2105

dscf2107

Add comment December 19, 2008

Correcting the brightness of gateway m6827

On ubuntu the brightness keys don’t work out of the box. So you will need to edit the video_brightnessup and video_brightnessdown on /etc/acpi

Change the files to the following

/etc/acpi/video_brightnessup.sh
CURRENT=`cat /sys/class/backlight/acpi_video0/brightness`

case "$CURRENT" in

7)
echo -n 7 > /sys/class/backlight/acpi_video0/brightness;
;;
6)
echo -n 7 > /sys/class/backlight/acpi_video0/brightness;
;;
5)
echo -n 6 > /sys/class/backlight/acpi_video0/brightness;
;;
4)
echo -n 5 > /sys/class/backlight/acpi_video0/brightness;
;;
3)
echo -n 4 > /sys/class/backlight/acpi_video0/brightness;
;;
2)
echo -n 3 > /sys/class/backlight/acpi_video0/brightness;
;;
1)
echo -n 2 > /sys/class/backlight/acpi_video0/brightness;
;;
0)
echo -n 1 > /sys/class/backlight/acpi_video0/brightness;
;;
*) #default case
echo -n 4 > /sys/class/backlight/acpi_video0/brightness;
;;
esac

/etc/acpi/video_brightnessdown.sh

CURRENT=`cat /sys/class/backlight/acpi_video0/brightness`

case “$CURRENT” in

7)
echo -n 6 > /sys/class/backlight/acpi_video0/brightness;
;;
6)
echo -n 5 > /sys/class/backlight/acpi_video0/brightness;
;;
5)
echo -n 4 > /sys/class/backlight/acpi_video0/brightness;
;;
4)
echo -n 3 > /sys/class/backlight/acpi_video0/brightness;
;;
3)
echo -n 2 > /sys/class/backlight/acpi_video0/brightness;
;;
2)
echo -n 1 > /sys/class/backlight/acpi_video0/brightness;
;;
1)
echo -n 0 > /sys/class/backlight/acpi_video0/brightness;
;;
0)
echo -n 0 > /sys/class/backlight/acpi_video0/brightness;
;;
*) #default case
echo -n 4 > /sys/class/backlight/acpi_video0/brightness;
;;
esac

This method was is an edited form of the method frm digitalpbk's blog

Now the fn+up and fn+down should work correctly

Add comment December 10, 2008


Tags

airtel on linux amarok beryl bluetooth and ubuntu bootloader chainloader compiz compiz fusion cube dual boot evil first look on ubuntu fun gdm gnome grub GUI root install KDE4 lilo linux linux basic software M$ nautilus scripts obex pidgin restore grub root ruby script shipit shutdown su sudo sudo -i time up dude ubuntu vi vim vlc windows windows sucks wvdial zenity zenwalk

 

December 2008
S M T W T F S
« Nov   Jan »
 123456
78910111213
14151617181920
21222324252627
28293031  

About Me

Cyriac Thomas

A GNU/Linux enthusiast, Amateur Photographer, Design enthusiast who loves simplicity. An active tweeter @cyriacthomas.

RSS Photoblog

My Recent Tweets

Links

Archives

Blog Stats

Flickr Photos

I <3 the web

20032008(026)

20032008(021)

More Photos

del.icio.us/cyriacsmail

Bot Comments ;)