Sunday, September 10, 2006

Kopete Contacts view by email

I am used to setting the msn Contact List as view by-email...there is no such option in gaim 2.0 betas, or in kopete.. Either you have to set a custom nick for each and every contact or try to satisfy your eyes with the emoticons and ascii art people put as their nicks..I want my contact list to display contacts by their email addresses.So here is what I did to enable that in kopete.

* make sure that kopete is not running.
* delete ~/.kde/share/apps/kopete/contactlist.xml
* delete ~/.kde/share/config/kopeterc
* run kopete and add a new account..don't customize anything yet
* copy contactlist.xml to the directory where the script is
* run the following python script

link to script

it will create a file 'newlist.xml'.Save this to ~/.kde/share/apps/kopete/ and rename it as contactlist.xml..Now when you run kopete it should display all the contacts by their email addresses.


Saturday, September 09, 2006

Comics script

file name: comics
Downloads daily comic strips.

#!/bin/sh
shtdate=`date +%y%m%d`
lngyear=`date +%Y`
for i in $@
do
case $i in
garfeild)`wget -nd -P comix/ http://images.ucomics.com/comics/ga/${lngyear}/ga${shtdate}.gif`;;
calvin)cvyear=`date +%Y -d "-11 year"`;cvshtdate=`date +%y%m%d -d "-11 year"`;
`wget -nd -P comix/ http://images.ucomics.com/comics/ch/${cvyear}/ch${cvshtdate}.gif`;;
dilbert)fmtdate=`date +%Y%m%d`;
`wget -r -l1 -nd -P comix/ -A dilbert[0-9]*\.gif,dilbert[0-9]*\.jpg http://www.dilbert.com/comics/dilbert/archive/dilbert-${fmtdate}.html`;;
peanuts)fmtdate=`date +%Y%m%d`;
`wget -r -l1 -nd -P comix/ -A peanuts[0-9]*\.gif,peanuts[0-9]*\.jpg http://www.snoopy.com/comics/peanuts/archive/peanuts-${fmtdate}.html`;;
bornloser)fmtdate=`date +%Y%m%d`;
`wget -r -l1 -nd -P comix/ -A bornloser[0-9]*\.gif,bornloser[0-9]*\.jpg http://www.comics.com/comics/bornloser/archive/bornloser-${fmtdate}.html`;;
archie)fmtdate=`date +%d -d "-3 day"`;
`wget -nd -P comix/ http://www.archiecomics.com/pops_shop/dailycomics/image${fmtdate}.gif`;;
*)echo "you entered shit";;
esac
done

Comics script (Front end)

file name:zcomics
this is just a zenity front-end to comic script
Updates: 13/Sep (debug)
#!/bin/bash
foo=`zenity --list --title="Which Comics?" --window-icon='question' --width=200 --height=280 --checklist --separator=' ' --column='Yeh?' --column="Comic" 'FALSE' 'garfeild' 'FALSE' 'calvin' 'FALSE' 'dilbert' 'FALSE' 'peanuts' 'FALSE' 'bornloser' 'FALSE' 'archie'`

(sh comics $foo)&

dcount=`echo $foo|wc -w`
fcount=`ls comix/|grep -E "(\.gif)$|(\.jpg)$"|wc -w`
mcount=`ls comix/|grep -E "(\.gif)$|(\.jpg)$"|wc -w`
tcount=$[ $fcount+$dcount ]
scount="0"
while [ $fcount -lt $tcount ];do fcount=`ls comix/|grep -E "(\.gif)$|(\.jpg)$"|wc -w`;sleep 1s;scount=$[ $fcount-$mcount ];echo $[ $[$scount*100]/$dcount];done|zenity --progress --percentage="0"
echo $foo

nautilus comix/

Comics script (Screen Shots)


Tuesday, September 05, 2006

Nautilus copy to and move to scripts

Download nautilus script archive

Extract to ~/.gnome2/nautilus-scripts

#!/bin/bash
#move files to
suris=`echo $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS`
foo=`zenity --file-selection --directory`
mv $suris $foo

#!/bin/bash
#copy files to
suris=`echo $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS`
foo=`zenity --file-selection --directory`
cp -R $suris $foo



Sunday, September 03, 2006

firefox bookmarks uploading script

#!/bin/bash
#firefox bookmarks uploading script

_folder='/home/vishah/.mozilla/firefox/dzvmnj5a.default'
_server='ftp.angelfire.com'
_file='bookmarks.html'
_user='planet/vishah'
_pass='password'

cd $_folder

ftp -n $_server<<END_SCRIPT
quote user $_user
quote pass $_pass
put $_file
quit
END_SCRIPT
exit 0

Saturday, September 02, 2006

open terminal here says Nautilus

Download nautilus-scripts archive

Extract to ~/.gnome2/nautilus-scripts

#!/bin/bash
#Created by vishah
#Opens a gnome terminal with the working directory same as nautilus
cwd=`echo $NAUTILUS_SCRIPT_CURRENT_URI|grep -oE '[/][^//].+'`
gnome-terminal --working-directory=$cwd

open a terminal with the working directory as Nautilus

Opens a nautilus window as root.

Download nautilus-scripts archive

# Opens a nautilus window as root.

foo=`gksudo -u root -k -m "enter your password for nautilus root access" /bin/echo "got r00t?"`
#foo=`expect /home/vishah/scripts/su.exp`
sudo nautilus --no-desktop $NAUTILUS_SCRIPT_CURRENT_URI

Use this to open a nautilus window as root.

Nautilus chown script

Download nautilus-scripts archive

#!/bin/bash

# Change ownership to vishah.
suri=`echo $NAUTILUS_SCRIPT_CURRENT_URI|grep -oE '[/][^//].+'`
foo=`gksudo -u root -k -m "Enter root pass" /bin/echo "you got root?"`
`sudo chown -R vishah:vishah $suri `

Select files and change ownership with a click

Kopete DP steal


#!/bin/bash
#kopete script
foo=`kdialog --getopenfilename "/home/vishah/.kde/share/apps/kopete/msnpictures/"`
dcop kopete default setGlobalPhoto $foo

this script can be run from the alias plugin of kopete and will open a dialog to select all the downloaded display pics of the buddies in contact list.and when you select one of em it will set the pic as your global DP.

A script to assign a fortune epigram to kopete nick..


#!/bin/bash
foo=`fortune -s -n 50 |tr -d "\b\n\r\t\v[:cntrl:][:punct:]"`
dcop kopete default setGlobalNickname "`echo $foo`"
`Xdialog --info "$foo" 350x100 2000`

using /exec in kopete