blob: 690f8b9651277aab8e29563922023cc9a0ba3596 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#!/bin/bash
readonly DEFAULT_NICK='parabola-user' # ASSERT: as defined in ~/.purple/accounts.xml and ~/.purple/blist.xml
readonly NETWORK='irc.freenode.net'
readonly DEFAULT_ACCOUNT="${DEFAULT_NICK}@${NETWORK}"
readonly CURRENT_NICK=$(grep '<name>.*</name>' ~/.purple/accounts.xml | sed "s|.*<name>\(.*\)@${NETWORK}</name>.*|\1|")
readonly KEEP_NICK_MSG="Your Parabola IRC nick-name is currently '${CURRENT_NICK}'.\n\n\
Would you like to keep this nick-name, or choose another?"
# if which gxmessage > /dev/null # FIXME: issue #2208
if which zenity > /dev/null
then if [[ "${CURRENT_NICK}" == "${DEFAULT_NICK}" ]] || \
zenity --question --width=480 \
--title="Parabola IRC Login" \
--text="${KEEP_NICK_MSG}" \
--ok-label="Choose a different nick-name" \
--cancel-label="Keep this nick-name"
then nick=$(zenity --entry --width=320 \
--title="Parabola IRC Login" \
--text="Choose a nick-name:" \
--entry-text=${CURRENT_NICK} )
nick=$([[ "${nick// /}" ]] && echo ${nick// /} || echo ${DEFAULT_NICK})
else nick=${CURRENT_NICK}
sed -i 's|^Exec=.*|Exec=pidgin|' ~/Desktop/parabola-irc.desktop
rm ~/parabola-irc.sh
fi
cd ~/.purple/
sed "s|${DEFAULT_ACCOUNT}|${nick}@${NETWORK}|" ./accounts.default.xml > ./accounts.xml
sed "s|${DEFAULT_ACCOUNT}|${nick}@${NETWORK}|" ./blist.default.xml > ./blist.xml
fi
pidgin
|