diff options
author | Holger Paradies <retabell@gmx.de> | 2014-04-20 22:15:31 +0200 |
---|---|---|
committer | Holger Paradies <retabell@gmx.de> | 2014-04-20 22:22:57 +0200 |
commit | 70aa6d15c62ba69e34674e74d116b35c14cce980 (patch) | |
tree | 06b541eb087bfb50be7da6f98de5bc2668531ce9 /kanotix-irc/kanotix-irc | |
parent | 0df53c9214774d6f967e6d0f3a46458d0f431f43 (diff) | |
download | kanotix-packages-70aa6d15c62ba69e34674e74d116b35c14cce980.zip kanotix-packages-70aa6d15c62ba69e34674e74d116b35c14cce980.tar.gz |
kanotix-irc-1.0.6 support hexchat
Diffstat (limited to 'kanotix-irc/kanotix-irc')
-rwxr-xr-x | kanotix-irc/kanotix-irc | 68 |
1 files changed, 67 insertions, 1 deletions
diff --git a/kanotix-irc/kanotix-irc b/kanotix-irc/kanotix-irc index 6f1e0d2..ab0bde7 100755 --- a/kanotix-irc/kanotix-irc +++ b/kanotix-irc/kanotix-irc @@ -41,6 +41,7 @@ KSIRC="$(which ksirc)" || KSIRC="/usr/bin/ksirc" KONVERSATION="$(which konversation)" || KONVERSATION="/usr/bin/konversation" WEECHAT="$(which weechat-curses)" || WEECHAT="/usr/bin/weechat-curses" XCHAT="$(which xchat)" || XCHAT="/usr/bin/xchat" +HEXCHAT="$(which hexchat)" || HEXCHAT="/usr/bin/hexchat" # internal functions inputbox() @@ -383,6 +384,66 @@ _EOF_ [ "$RETC" -ne 0 ] && return 127 || exit 0 } +kanotix_hexchat() +{ + HEXCHATCFG="$($MKTEMP -dp /tmp/ .hexchat-XXXXXXXXXX)" + + if [ -e ~/.config/hexchat/ ]; then + cp -r ~/.config/hexchat/* "$HEXCHATCFG/" + # delete improper lines + sed -i '/gui_join_dialog/d; + /gui_slist_skip/d; + /gui_slist_select/d; + /irc_nick1/d; + /irc_nick2/d; + /irc_nick3/d; + /irc_user_name/d; + /irc_real_name/d' "$HEXCHATCFG/hexchat.conf" + fi + cat <<_EOF_ >>"$HEXCHATCFG/hexchat.conf" +gui_join_dialog = 0 +gui_slist_select = 0 +gui_slist_skip = 1 +irc_nick1 = $NICK +irc_nick2 = ${NICK}_ +irc_nick3 = ${NICK}__ +_EOF_ + + + cat <<_EOF_ >"$HEXCHATCFG/servlist.conf" +N=FreeNode +J=#kanotix +E=UTF-8 (Unicode) +F=63 +_EOF_ + # if ssl port configured then add ssl options + if [ $FLL_IRC_PORT = "7000" ]; then + cat <<_EOF_ >>"$HEXCHATCFG/servlist.conf" +D=1 +_EOF_ + else + cat <<_EOF_ >>"$HEXCHATCFG/servlist.conf" +D=0 +_EOF_ + fi + cat <<_EOF_ >>"$HEXCHATCFG/servlist.conf" +S=irc.freenode.net/$FLL_IRC_PORT +S=irc.freenode.net/+7000 +_EOF_ + + cat <<_EOF_ >"$HEXCHATCFG/commands.conf" +NAME cmd +CMD exec -o &2 +_EOF_ + + "$HEXCHAT" -d "$HEXCHATCFG" + RETC="$?" + rm -rf "$HEXCHATCFG" + [ "$RETC" -ne 0 ] && return 127 || exit 0 +} + + + ############################################################################## # int main(void); # ############################################################################## @@ -469,6 +530,11 @@ else [ -x "$KSIRC" ] && \ exec "$KSIRC" --server "$FLL_IRC_SERVER" --channel "$FLL_IRC_CHANNEL" --nick "$NICK" + if [ -x "$HEXCHAT" ]; then + kanotix_hexchat + exit "$?" + fi + if [ -x "$XCHAT" ]; then kanotix_xchat exit "$?" @@ -480,7 +546,7 @@ fi # Oops... echo "ERROR: failed to start any suitable IRC Client" -for i in "$DIALOG" "$XDIALOG" "$BITCHX" "$IRSSI" "$KSIRC" "$KONVERSATION" "$WEECHAT" "$XCHAT"; do +for i in "$DIALOG" "$XDIALOG" "$BITCHX" "$IRSSI" "$KSIRC" "$KONVERSATION" "$WEECHAT" "$XCHAT" "$HEXCHAT" ; do if [ -x "$i" ]; then echo "$i: found." else |