#!/bin/bash

DEFAULT_NICK='parabola-user' # ASSERT: this is defined in ~/.purple/accounts.xml

ts=$(( $(date +%s) / 1000000 ))
nick=$(zenity --entry --width=320           \
              --title="Parabola IRC Login"  \
              --text "Choose a nick-name:"  \
              --entry-text=$DEFAULT_NICK-$ts)
nick=${nick// /}
[ "$nick" ] || nick=$DEFAULT_NICK-$ts

sed -i "s|$DEFAULT_NICK@irc.freenode.net|$nick@irc.freenode.net|" ~/.purple/accounts.xml
sed -i "s|$DEFAULT_NICK@irc.freenode.net|$nick@irc.freenode.net|" ~/.purple/blist.xml

pidgin &
