parabola-irc.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. DEFAULT_NICK='parabola-user' # ASSERT: as defined in ~/.purple/accounts.xml and ~/.purple/blist.xml
  3. if [ -z "$(grep $DEFAULT_NICK@irc.freenode.net ~/.purple/accounts.xml)" ] || \
  4. [ -z "$(grep $DEFAULT_NICK@irc.freenode.net ~/.purple/blist.xml )" ]
  5. then if zenity --question --width=320 \
  6. --title="Parabola IRC Login" \
  7. --text="The default 'parabola-user' freenode IRC account has been modified. \
  8. This desktop shortcut is only for that account. You can either restore Pidgin to it's default \
  9. configuration (deleting any changes you have made); or delete this shortcut from the desktop." \
  10. --ok-label="Reset Pidgin completely" \
  11. --cancel-label="Remove this desktop shortcut"
  12. then cp ~/.purple/accounts.default.xml ~/.purple/accounts.xml
  13. cp ~/.purple/blist.default.xml ~/.purple/blist.xml
  14. else rm ~/Desktop/parabola-irc.desktop
  15. rm ~/parabola-irc.sh
  16. exit
  17. fi
  18. fi
  19. nick=$(zenity --entry --width=320 \
  20. --title="Parabola IRC Login" \
  21. --text="Choose a nick-name:" \
  22. --entry-text=$DEFAULT_NICK )
  23. nick=${nick// /} ; [ "$nick" ] || nick=$DEFAULT_NICK ;
  24. sed -i "s|$DEFAULT_NICK@irc.freenode.net|$nick@irc.freenode.net|" ~/.purple/accounts.xml
  25. sed -i "s|$DEFAULT_NICK@irc.freenode.net|$nick@irc.freenode.net|" ~/.purple/blist.xml
  26. pidgin