From ca3498d42d29383024382b0eb983f97ab4e6b614 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Wed, 25 Oct 2017 16:22:57 +0200 Subject: move some files into subdirs --- Makefile.am | 21 ++-- autogen.sh | 27 +++-- colorless.theme | 290 ------------------------------------------------ configure.ac | 2 + default.theme | 294 ------------------------------------------------- file2header.sh | 5 - irssi-version.sh | 28 ----- syncdocs.sh | 101 ----------------- syncscripts.sh | 38 ------- syntax.pl | 80 -------------- themes/Makefile.am | 5 + themes/colorless.theme | 290 ++++++++++++++++++++++++++++++++++++++++++++++++ themes/default.theme | 294 +++++++++++++++++++++++++++++++++++++++++++++++++ utils/Makefile.am | 4 + utils/file2header.sh | 5 + utils/irssi-version.sh | 28 +++++ utils/syncdocs.sh | 102 +++++++++++++++++ utils/syncscripts.sh | 39 +++++++ utils/syntax.pl | 80 ++++++++++++++ 19 files changed, 872 insertions(+), 861 deletions(-) delete mode 100644 colorless.theme delete mode 100644 default.theme delete mode 100755 file2header.sh delete mode 100755 irssi-version.sh delete mode 100755 syncdocs.sh delete mode 100755 syncscripts.sh delete mode 100755 syntax.pl create mode 100644 themes/Makefile.am create mode 100644 themes/colorless.theme create mode 100644 themes/default.theme create mode 100644 utils/Makefile.am create mode 100755 utils/file2header.sh create mode 100755 utils/irssi-version.sh create mode 100755 utils/syncdocs.sh create mode 100755 utils/syncscripts.sh create mode 100755 utils/syntax.pl diff --git a/Makefile.am b/Makefile.am index 75d502f1..f52ac92f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,33 +7,26 @@ CLEANFILES = default-config.h default-theme.h @MAINTAINER_MODE_TRUE@.PHONY: irssi-version.h default-config.h: $(srcdir)/irssi.conf - $(srcdir)/file2header.sh $(srcdir)/irssi.conf default_config > default-config.h + $(srcdir)/utils/file2header.sh $(srcdir)/irssi.conf default_config > default-config.h -default-theme.h: $(srcdir)/default.theme - $(srcdir)/file2header.sh $(srcdir)/default.theme default_theme > default-theme.h +default-theme.h: $(srcdir)/themes/default.theme + $(srcdir)/utils/file2header.sh $(srcdir)/themes/default.theme default_theme > default-theme.h irssi-version.h: - VERSION="$(VERSION)" $(srcdir)/irssi-version.sh $(srcdir) | \ - cmp -s - $@ || VERSION="$(VERSION)" $(srcdir)/irssi-version.sh $(srcdir) >$@ + VERSION="$(VERSION)" $(srcdir)/utils/irssi-version.sh $(srcdir) | \ + cmp -s - $@ || VERSION="$(VERSION)" $(srcdir)/utils/irssi-version.sh $(srcdir) >$@ -SUBDIRS = src docs scripts +SUBDIRS = src docs scripts themes utils confdir = $(sysconfdir) conf_DATA = irssi.conf -themedir = $(datadir)/irssi/themes -theme_DATA = default.theme colorless.theme - pkginclude_HEADERS = irssi-config.h irssi-version.h EXTRA_DIST = \ ChangeLog \ autogen.sh \ README.md \ - file2header.sh \ $(conf_DATA) \ - $(theme_DATA) \ irssi-config.in \ - irssi-icon.png \ - irssi-version.sh \ - syntax.pl + irssi-icon.png diff --git a/autogen.sh b/autogen.sh index a9e354c9..9feb0872 100755 --- a/autogen.sh +++ b/autogen.sh @@ -3,21 +3,24 @@ PKG_NAME="Irssi" -srcdir=`dirname $0` +srcdir=`dirname "$0"` test -z "$srcdir" && srcdir=. +mydir=`pwd` -if test ! -f $srcdir/configure.ac; then - echo -n "**Error**: Directory \`$srcdir\' does not look like the" +if test ! -f "$srcdir"/configure.ac; then + echo -n "**Error**: Directory \`$srcdir' does not look like the" echo " top-level $PKG_NAME directory" exit 1 fi +cd "$srcdir" + # create help files echo "Creating help files..." -perl syntax.pl +perl utils/syntax.pl echo "Creating ChangeLog..." -git log > $srcdir/ChangeLog +git log > ChangeLog if test "$?" -ne 0; then echo "**Error**: ${PKG_NAME} Autogen must be run in a git clone, cannot proceed." exit 1 @@ -38,17 +41,19 @@ fi rm -f aclocal.m4 echo "Running autoreconf ..." -autoreconf -i || exit 1 +autoreconf -i || exit $? + +# make sure perl hashes have correct length +find src/perl -name '*.c' -o -name '*.xs' -exec grep -n hv_store {} + | perl -l -ne 'if (/"(\w+)",\s*(\d+)/ && $2 != length $1) { $X=1; print "Incorrect key length in $_" } END { exit $X }' + +cd "$mydir" conf_flags="--enable-maintainer-mode" if test x$NOCONFIGURE = x; then - echo Running $srcdir/configure $conf_flags "$@" ... - $srcdir/configure $conf_flags "$@" \ + echo Running "$srcdir"/configure $conf_flags "$@" ... + "$srcdir"/configure $conf_flags "$@" \ && echo Now type \`make\' to compile $PKG_NAME || exit 1 else echo Skipping configure process. fi - -# make sure perl hashes have correct length -find src/perl -name '*.c' -o -name '*.xs' -exec grep -n hv_store {} + | perl -l -ne 'if (/"(\w+)",\s*(\d+)/ && $2 != length $1) { $X=1; print "Incorrect key length in $_" } END { exit $X }' diff --git a/colorless.theme b/colorless.theme deleted file mode 100644 index 1b26f628..00000000 --- a/colorless.theme +++ /dev/null @@ -1,290 +0,0 @@ -# When testing changes, the easiest way to reload the theme is with /RELOAD. -# This reloads the configuration file too, so if you did any changes remember -# to /SAVE it first. Remember also that /SAVE overwrites the theme file with -# old data so keep backups :) - -# TEMPLATES: - -# The real text formats that irssi uses are the ones you can find with -# /FORMAT command. Back in the old days all the colors and texts were mixed -# up in those formats, and it was really hard to change the colors since you -# might have had to change them in tens of different places. So, then came -# this templating system. - -# Now the /FORMATs don't have any colors in them, and they also have very -# little other styling. Most of the stuff you need to change is in this -# theme file. If you can't change something here, you can always go back -# to change the /FORMATs directly, they're also saved in these .theme files. - -# So .. the templates. They're those {blahblah} parts you see all over the -# /FORMATs and here. Their usage is simply {name parameter1 parameter2}. -# When irssi sees this kind of text, it goes to find "name" from abstracts -# block below and sets "parameter1" into $0 and "parameter2" into $1 (you -# can have more parameters of course). Templates can have subtemplates. -# Here's a small example: -# /FORMAT format hello {colorify {underline world}} -# abstracts = { colorify = "%G$0-%n"; underline = "%U$0-%U"; } -# When irssi expands the templates in "format", the final string would be: -# hello %G%Uworld%U%n -# ie. underlined bright green "world" text. -# and why "$0-", why not "$0"? $0 would only mean the first parameter, -# $0- means all the parameters. With {underline hello world} you'd really -# want to underline both of the words, not just the hello (and world would -# actually be removed entirely). - -# COLORS: - -# You can find definitions for the color format codes in docs/formats.txt. - -# There's one difference here though. %n format. Normally it means the -# default color of the terminal (white mostly), but here it means the -# "reset color back to the one it was in higher template". For example -# if there was /FORMAT test %g{foo}bar, and foo = "%Y$0%n", irssi would -# print yellow "foo" (as set with %Y) but "bar" would be green, which was -# set at the beginning before the {foo} template. If there wasn't the %g -# at start, the normal behaviour of %n would occur. If you _really_ want -# to use the terminal's default color, use %N. - -############################################################################# - -# default foreground color (%N) - -1 is the "default terminal color" -default_color = "-1"; - -# print timestamp/servertag at the end of line, not at beginning -info_eol = "false"; - -# these characters are automatically replaced with specified color -# (dark grey by default) -#replaces = { "[]=" = "%K$*%n"; }; - -abstracts = { - ## - ## generic - ## - - # text to insert at the beginning of each non-message line - line_start = "-!- "; - - # timestamp styling, nothing by default - timestamp = "$*"; - - # any kind of text that needs hilighting, default is to bold - hilight = "%_$*%_"; - - # any kind of error message, default is bright red - error = "%_$*%_"; - - # channel name is printed - channel = "$*"; - - # nick is printed - nick = "$*"; - - # nick host is printed - nickhost = "[$*]"; - - # server name is printed - server = "$*"; - - # some kind of comment is printed - comment = "[$*]"; - - # reason for something is printed (part, quit, kick, ..) - reason = "{comment $*}"; - - # mode change is printed ([+o nick]) - mode = "{comment $*}"; - - ## - ## channel specific messages - ## - - # highlighted nick/host is printed (joins) - channick_hilight = "$*"; - chanhost_hilight = "{nickhost $*}"; - - # nick/host is printed (parts, quits, etc.) - channick = "$*"; - chanhost = "{nickhost $*}"; - - # highlighted channel name is printed - channelhilight = "$*"; - - # ban/ban exception/invite list mask is printed - ban = "$*"; - - ## - ## messages - ## - - # the basic styling of how to print message, $0 = nick mode, $1 = nick - msgnick = "<$0$1-> %|"; - - # message from you is printed. "msgownnick" specifies the styling of the - # nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the - # whole line. - - # Example1: You want the message text to be green: - # ownmsgnick = "{msgnick $0 $1-}%g"; - # Example2.1: You want < and > chars to be yellow: - # ownmsgnick = "%Y{msgnick $0 $1-%Y}%n"; - # (you'll also have to remove <> from replaces list above) - # Example2.2: But you still want to keep <> grey for other messages: - # pubmsgnick = "%K{msgnick $0 $1-%K}%n"; - # pubmsgmenick = "%K{msgnick $0 $1-%K}%n"; - # pubmsghinick = "%K{msgnick $1 $0$2-%n%K}%n"; - # ownprivmsgnick = "%K{msgnick $*%K}%n"; - # privmsgnick = "%K{msgnick %R$*%K}%n"; - - # $0 = nick mode, $1 = nick - ownmsgnick = "{msgnick $0 $1-}"; - ownnick = "$*"; - - # public message in channel, $0 = nick mode, $1 = nick - pubmsgnick = "{msgnick $0 $1-}"; - pubnick = "$*"; - - # public message in channel meant for me, $0 = nick mode, $1 = nick - pubmsgmenick = "{msgnick $0 $1-}"; - menick = "%_$*%_"; - - # public highlighted message in channel - # $0 = highlight color, $1 = nick mode, $2 = nick - pubmsghinick = "{msgnick $1 $0$2-%n}"; - - # channel name is printed with message - msgchannel = ":$*"; - - # private message, $0 = nick, $1 = host - privmsg = "[$0($1-)] "; - - # private message from you, $0 = "msg", $1 = target nick - ownprivmsg = "[$0($1-)] "; - - # own private message in query - ownprivmsgnick = "{msgnick $*}"; - ownprivnick = "$*"; - - # private message in query - privmsgnick = "{msgnick $*}"; - - ## - ## Actions (/ME stuff) - ## - - # used internally by this theme - action_core = " * $*"; - - # generic one that's used by most actions - action = "{action_core $*} "; - - # own action, both private/public - ownaction = "{action $*}"; - - # own action with target, both private/public - ownaction_target = "{action_core $0}:$1 "; - - # private action sent by others - pvtaction = " (*) $* "; - pvtaction_query = "{action $*}"; - - # public action sent by others - pubaction = "{action $*}"; - - - ## - ## other IRC events - ## - - # whois - whois = "%# $[8]0 : $1-"; - - # notices - ownnotice = "[$0($1-)] "; - notice = "-$*- "; - pubnotice_channel = ":$*"; - pvtnotice_host = "($*)"; - servernotice = "!$* "; - - # CTCPs - ownctcp = "[$0($1-)] "; - ctcp = "$*"; - - # wallops - wallop = "$*: "; - wallop_nick = "$*"; - wallop_action = " * $* "; - - # netsplits - netsplit = "$*"; - netjoin = "$*"; - - # /names list - names_prefix = ""; - names_nick = "[$0$1-] "; - names_nick_op = "{names_nick $*}"; - names_nick_halfop = "{names_nick $*}"; - names_nick_voice = "{names_nick $*}"; - names_users = "[$*]"; - names_channel = "$*"; - - # DCC - dcc = "$*"; - dccfile = "$*"; - - # DCC chat, own msg/action - dccownmsg = "[$0($1-)] "; - dccownnick = "$*"; - dccownquerynick = "$*"; - dccownaction = "{action $*}"; - dccownaction_target = "{action_core $0}:$1 "; - - # DCC chat, others - dccmsg = "[$1-($0)] "; - dccquerynick = "$*"; - dccaction = " (*dcc*) $* %|"; - - ## - ## statusbar - ## - - # default background for all statusbars. You can also give - # the default foreground color for statusbar items. - sb_background = "%8"; - - # default backround for "default" statusbar group - #sb_default_bg = "%8"; - # background for prompt / input line - sb_prompt_bg = "%n"; - # background for info statusbar - sb_info_bg = "%8"; - # background for topicbar (same default) - #sb_topic_bg = "%8"; - - # text at the beginning of statusbars. "sb" already puts a space there, - # so we don't use anything by default. - sbstart = ""; - # text at the end of statusbars. Use space so that it's never - # used for anything. - sbend = " "; - - prompt = "[$*] "; - - sb = " [$*]"; - sbmode = "(+$*)"; - sbaway = " (zZzZ)"; - sbservertag = ":$0 (change with ^X)"; - - # activity in statusbar - - # ',' separator - sb_act_sep = "$*"; - # normal text - sb_act_text = "$*"; - # public message - sb_act_msg = "%_$*%_"; - # hilight - sb_act_hilight = "%8$*%8"; - # hilight with specified color, $0 = color, $1 = text - sb_act_hilight_color = "$0$1-%n"; -}; diff --git a/configure.ac b/configure.ac index 9c026c5d..4b65d434 100644 --- a/configure.ac +++ b/configure.ac @@ -661,6 +661,8 @@ scripts/examples/Makefile docs/Makefile docs/help/Makefile docs/help/in/Makefile +utils/Makefile +themes/Makefile irssi-config ]) diff --git a/default.theme b/default.theme deleted file mode 100644 index 956d7c4f..00000000 --- a/default.theme +++ /dev/null @@ -1,294 +0,0 @@ -# When testing changes, the easiest way to reload the theme is with /RELOAD. -# This reloads the configuration file too, so if you did any changes remember -# to /SAVE it first. Remember also that /SAVE overwrites the theme file with -# old data so keep backups :) - -# TEMPLATES: - -# The real text formats that irssi uses are the ones you can find with -# /FORMAT command. Back in the old days all the colors and texts were mixed -# up in those formats, and it was really hard to change the colors since you -# might have had to change them in tens of different places. So, then came -# this templating system. - -# Now the /FORMATs don't have any colors in them, and they also have very -# little other styling. Most of the stuff you need to change is in this -# theme file. If you can't change something here, you can always go back -# to change the /FORMATs directly, they're also saved in these .theme files. - -# So .. the templates. They're those {blahblah} parts you see all over the -# /FORMATs and here. Their usage is simply {name parameter1 parameter2}. -# When irssi sees this kind of text, it goes to find "name" from abstracts -# block below and sets "parameter1" into $0 and "parameter2" into $1 (you -# can have more parameters of course). Templates can have subtemplates. -# Here's a small example: -# /FORMAT format hello {colorify {underline world}} -# abstracts = { colorify = "%G$0-%n"; underline = "%U$0-%U"; } -# When irssi expands the templates in "format", the final string would be: -# hello %G%Uworld%U%n -# ie. underlined bright green "world" text. -# and why "$0-", why not "$0"? $0 would only mean the first parameter, -# $0- means all the parameters. With {underline hello world} you'd really -# want to underline both of the words, not just the hello (and world would -# actually be removed entirely). - -# COLORS: - -# You can find definitions for the color format codes in docs/formats.txt. - -# There's one difference here though. %n format. Normally it means the -# default color of the terminal (white mostly), but here it means the -# "reset color back to the one it was in higher template". For example -# if there was /FORMAT test %g{foo}bar, and foo = "%Y$0%n", irssi would -# print yellow "foo" (as set with %Y) but "bar" would be green, which was -# set at the beginning before the {foo} template. If there wasn't the %g -# at start, the normal behaviour of %n would occur. If you _really_ want -# to use the terminal's default color, use %N. - -############################################################################# - -# default foreground color (%N) - -1 is the "default terminal color" -default_color = "-1"; - -# print timestamp/servertag at the end of line, not at beginning -info_eol = "false"; - -# these characters are automatically replaced with specified color -# (dark grey by default) -replaces = { "[]=" = "%K$*%n"; }; - -abstracts = { - ## - ## generic - ## - - # text to insert at the beginning of each non-message line - line_start = "%B-%n!%B-%n "; - - # timestamp styling, nothing by default - timestamp = "$*"; - - # any kind of text that needs hilighting, default is to bold - hilight = "%_$*%_"; - - # any kind of error message, default is bright red - error = "%R$*%n"; - - # channel name is printed - channel = "%_$*%_"; - - # nick is printed - nick = "%_$*%_"; - - # nick host is printed - nickhost = "[$*]"; - - # server name is printed - server = "%_$*%_"; - - # some kind of comment is printed - comment = "[$*]"; - - # reason for something is printed (part, quit, kick, ..) - reason = "{comment $*}"; - - # mode change is printed ([+o nick]) - mode = "{comment $*}"; - - ## - ## channel specific messages - ## - - # highlighted nick/host is printed (joins) - channick_hilight = "%C$*%n"; - chanhost_hilight = "{nickhost %c$*%n}"; - - # nick/host is printed (parts, quits, etc.) - channick = "%c$*%n"; - chanhost = "{nickhost $*}"; - - # highlighted channel name is printed - channelhilight = "%c$*%n"; - - # ban/ban exception/invite list mask is printed - ban = "%c$*%n"; - - ## - ## messages - ## - - # the basic styling of how to print message, $0 = nick mode, $1 = nick - msgnick = "%K<%n$0$1-%K>%n %|"; - - # message from you is printed. "ownnick" specifies the styling of the - # nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the - # whole line. - - # Example1: You want the message text to be green: - # ownmsgnick = "{msgnick $0 $1-}%g"; - # Example2.1: You want < and > chars to be yellow: - # ownmsgnick = "%Y{msgnick $0 $1-%Y}%n"; - # (you'll also have to remove <> from replaces list above) - # Example2.2: But you still want to keep <> grey for other messages: - # pubmsgnick = "%K{msgnick $0 $1-%K}%n"; - # pubmsgmenick = "%K{msgnick $0 $1-%K}%n"; - # pubmsghinick = "%K{msgnick $1 $0$2-%n%K}%n"; - # ownprivmsgnick = "%K{msgnick $*%K}%n"; - # privmsgnick = "%K{msgnick %R$*%K}%n"; - - # $0 = nick mode, $1 = nick - ownmsgnick = "{msgnick $0 $1-}"; - ownnick = "%_$*%n"; - - # public message in channel, $0 = nick mode, $1 = nick - pubmsgnick = "{msgnick $0 $1-}"; - pubnick = "%N$*%n"; - - # public message in channel meant for me, $0 = nick mode, $1 = nick - pubmsgmenick = "{msgnick $0 $1-}"; - menick = "%Y$*%n"; - - # public highlighted message in channel - # $0 = highlight color, $1 = nick mode, $2 = nick - pubmsghinick = "{msgnick $1 $0$2-%n}"; - - # channel name is printed with message - msgchannel = "%K:%c$*%n"; - - # private message, $0 = nick, $1 = host - privmsg = "[%R$0%K(%r$1-%K)%n] "; - - # private message from you, $0 = "msg", $1 = target nick - ownprivmsg = "[%r$0%K(%R$1-%K)%n] "; - - # own private message in query - ownprivmsgnick = "{msgnick $*}"; - ownprivnick = "%_$*%n"; - - # private message in query - privmsgnick = "{msgnick %R$*%n}"; - - ## - ## Actions (/ME stuff) - ## - - # used internally by this theme - action_core = "%_ * $*%n"; - - # generic one that's used by most actions - action = "{action_core $*} "; - - # own action, both private/public - ownaction = "{action $*}"; - - # own action with target, both private/public - ownaction_target = "{action_core $0}%K:%c$1%n "; - - # private action sent by others - pvtaction = "%_ (*) $*%n "; - pvtaction_query = "{action $*}"; - - # public action sent by others - pubaction = "{action $*}"; - - - ## - ## other IRC events - ## - - # whois - whois = "%# $[8]0 : $1-"; - - # notices - ownnotice = "[%r$0%K(%R$1-%K)]%n "; - notice = "%K-%M$*%K-%n "; - pubnotice_channel = "%K:%m$*"; - pvtnotice_host = "%K(%m$*%K)"; - servernotice = "%g!$*%n "; - - # CTCPs - ownctcp = "[%r$0%K(%R$1-%K)] "; - ctcp = "%g$*%n"; - - # wallops - wallop = "%_$*%n: "; - wallop_nick = "%n$*"; - wallop_action = "%_ * $*%n "; - - # netsplits - netsplit = "%R$*%n"; - netjoin = "%C$*%n"; - - # /names list - names_prefix = ""; - names_nick = "[%_$0%_$1-] "; - names_nick_op = "{names_nick $*}"; - names_nick_halfop = "{names_nick $*}"; - names_nick_voice = "{names_nick $*}"; - names_users = "[%g$*%n]"; - names_channel = "%G$*%n"; - - # DCC - dcc = "%g$*%n"; - dccfile = "%_$*%_"; - - # DCC chat, own msg/action - dccownmsg = "[%r$0%K($1-%K)%n] "; - dccownnick = "%R$*%n"; - dccownquerynick = "%_$*%n"; - dccownaction = "{action $*}"; - dccownaction_target = "{action_core $0}%K:%c$1%n "; - - # DCC chat, others - dccmsg = "[%G$1-%K(%g$0%K)%n] "; - dccquerynick = "%G$*%n"; - dccaction = "%_ (*dcc*) $*%n %|"; - - ## - ## statusbar - ## - - # default background for all statusbars. You can also give - # the default foreground color for statusbar items. - sb_background = "%4%w"; - - # default backround for "default" statusbar group - #sb_default_bg = "%4"; - # background for prompt / input line - sb_prompt_bg = "%n"; - # background for info statusbar - sb_info_bg = "%8"; - # background for topicbar (same default) - #sb_topic_bg = "%4"; - - # text at the beginning of statusbars. "sb" already puts a space there, - # so we don't use anything by default. - sbstart = ""; - # text at the end of statusbars. Use space so that it's never - # used for anything. - sbend = " "; - - topicsbstart = "{sbstart $*}"; - topicsbend = "{sbend $*}"; - - prompt = "[$*] "; - - sb = " %c[%n$*%c]%n"; - sbmode = "(%c+%n$*)"; - sbaway = " (%GzZzZ%n)"; - sbservertag = ":$0 (change with ^X)"; - sbnickmode = "$0"; - - # activity in statusbar - - # ',' separator - sb_act_sep = "%c$*"; - # normal text - sb_act_text = "%c$*"; - # public message - sb_act_msg = "%W$*"; - # hilight - sb_act_hilight = "%M$*"; - # hilight with specified color, $0 = color, $1 = text - sb_act_hilight_color = "$0$1-%n"; -}; diff --git a/file2header.sh b/file2header.sh deleted file mode 100755 index f25ae13b..00000000 --- a/file2header.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -echo "const char *$2 =" -cat $1|sed 's/\\/\\\\/g'|sed 's/"/\\"/g'|sed 's/^/\"/'|sed 's/$/\\n\"/' -echo ";" diff --git a/irssi-version.sh b/irssi-version.sh deleted file mode 100755 index 1fc6a558..00000000 --- a/irssi-version.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -DATE=`GIT_DIR=$1/.git git log -1 --pretty=format:%ai HEAD` - -VERSION_DATE=`echo $DATE | cut -f 1 -d ' ' | tr -d -` -VERSION_TIME=`echo $DATE | cut -f 2 -d ' ' | awk -F: '{printf "%d", $1$2}'` - -if test -z "$VERSION_DATE"; then - exec>&2 - echo "**Error**: `basename "$0"` must be run in a git clone, cannot proceed." - exit 1 -fi - -echo "#define IRSSI_VERSION_DATE $VERSION_DATE" -echo "#define IRSSI_VERSION_TIME $VERSION_TIME" - -if echo "${VERSION}" | grep -q -- -head; then - # -head version, get extra details from git if we can - git_version=$(GIT_DIR=$1/.git git describe --dirty --long --always --tags) - if [ $? = 0 ]; then - new_version="$(echo "${VERSION}" | sed 's/-head//')" - # Because the git tag won't yet include the next release we modify the git - # describe output using the version defined from configure.ac. - version="${new_version}-$(echo "${git_version}" | sed 's/^.*-[0-9]\+-//')" - echo "#undef PACKAGE_VERSION" - echo "#define PACKAGE_VERSION \"${version}\"" - fi -fi diff --git a/syncdocs.sh b/syncdocs.sh deleted file mode 100755 index 1187eec9..00000000 --- a/syncdocs.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/sh -e -# Run this to download FAQ and startup-HOWTO from irssi.org - -PKG_NAME="Irssi" - -site=https://irssi.org - -faq=$site/documentation/faq/ -howto=$site/documentation/startup/ - -# remove everything until H1 and optionally 2 DIVs before the -# FOOTER. May need to be adjusted as the source pages change -pageclean_regex='s{.*(?=\s*)?(\s*)?)}{\1\2}g;' - -srcdir=`dirname "$0"` -test -z "$srcdir" && srcdir=. - -if test ! -f "$srcdir"/configure.ac; then - echo -n "**Error**: Directory \`$srcdir' does not look like the" - echo " top-level $PKG_NAME directory" - exit 1 -fi - -# detect downloader app -downloader=false - -if type curl >/dev/null 2>&1 ; then - downloader="curl -Ssf" -elif type wget >/dev/null 2>&1 ; then - downloader="wget -nv -O-" -else - echo "**Error**: No wget or curl present" - echo "Install wget or curl, then run syncdocs.sh again" -fi - -# detect html converter app -converter=false -if [ "$1" = "-any" ]; then - any=true -else - any=false -fi - -if type w3m >/dev/null 2>&1 ; then - converter="w3m -o display_link_number=1 -dump -T text/html" - any=true -elif type lynx >/dev/null 2>&1 ; then - converter="lynx -dump -stdin -force_html" -elif type elinks >/dev/null 2>&1 ; then - converter="elinks -dump -force-html" -else - echo "**Error**: Neither w3m, nor lynx or elinks present" - echo "Install w3m, then run syncdocs.sh again" - exit 1 -fi - -if ! $any ; then - echo "**Error**: w3m not present" - echo "If you want to use lynx or elinks, run syncdocs.sh -any" - exit 1 -fi - -check_download() { - if test "$1" -ne 0 || test ! -e "$2" || test "$(wc -l "$2" | awk '{print $1}')" -le 1 ; then - rm -f "$2" - echo "... download failed ( $1 )" - exit 2 - fi -} - -download_it() { - echo "Downloading $1 from $2 ..." - ret=0 - $downloader "$2" > "$3".tmp || ret=$? - check_download "$ret" "$3".tmp - perl -i -0777 -p -e "$pageclean_regex" "$3".tmp - perl -i -0777 -p -e 's{\A}{'""'\n}' "$3".tmp - perl -i -0777 -p -e 's{\[email protected\]}{user\@host}g' "$3".tmp - mv "$3".tmp "$3" -} - -download_it "FAQ" "$faq" "$srcdir"/docs/faq.html -download_it "Startup How-To" "$howto" "$srcdir"/docs/startup-HOWTO.html - -# .html -> .txt with lynx or elinks -echo "Documentation: html -> txt..." - -cat "$srcdir"/docs/faq.html \ - | LC_ALL=en_IE.utf8 $converter \ - | perl -pe ' - s/^ *//; - if ($_ eq "\n" && $state eq "Q") { $_ = ""; } - elsif (/^([QA]):/) { $state = $1 } - elsif ($_ ne "\n") { $_ = " $_"; }; -' > docs/faq.txt - -cat "$srcdir"/docs/startup-HOWTO.html \ - | perl -pe "s/\\bhref=([\"\'])#.*?\\1//" \ - | LC_ALL=en_IE.utf8 $converter > "$srcdir"/docs/startup-HOWTO.txt diff --git a/syncscripts.sh b/syncscripts.sh deleted file mode 100755 index eee95a5e..00000000 --- a/syncscripts.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -e -# Run this script to sync dual lived scripts from scripts.irssi.org to scripts/ - -PKG_NAME="Irssi" - -scriptbase=https://scripts.irssi.org/scripts - -srcdir=`dirname "$0"` -test -z "$srcdir" && srcdir=. - -if test ! -f "$srcdir"/configure.ac; then - echo -n "**Error**: Directory \`$srcdir' does not look like the" - echo " top-level $PKG_NAME directory" - exit 1 -fi - -dl2='curl -Ssf' - -dl_it() { - echo "$1" - $dl2 -o "$srcdir/scripts/$1" "$scriptbase/$1" -} - -for script in \ - autoop.pl \ - autorejoin.pl \ - buf.pl \ - dns.pl \ - kills.pl \ - mail.pl \ - mlock.pl \ - quitmsg.pl \ - scriptassist.pl \ - usercount.pl \ - ; -do - dl_it $script -done diff --git a/syntax.pl b/syntax.pl deleted file mode 100755 index 33bd12b4..00000000 --- a/syntax.pl +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/perl -# -# This script reads the syntaces of commands from irssi source tree. -# Then it browses through all '.in' files in the current directory and -# substitutes '@SYNTAX:foo@' tags with real syntaces found. This data -# is written into the corresponding files without the '.in' extension. -# For example: help.in -> ../help -# -# This path has to be changed. It should point to your irssi/src directory -# Remember to include the asterisk ('*'). -$SRC_PATH='src'; - -@files = sort `find src -name '*.c'`; - -foreach $file (@files) { - open (FILE, "$file"); - while () { - chomp; - if (m!/\*.SYNTAX\:! || $state) { - s/^\s+/ /; - s/.*SYNTAX: //; - if (/^ [A-Z]+/) { - push @lines, $line; - $line = ""; - s/^ //; - } - $line .= $_; - if (m!\*/!) { - $line =~ s!\*/!!; - push @lines, $line; - $line = ""; - $state = 0; - } else { - $state = 1; - } - } - } - close (FILE); -} -while () { - next if (/Makefile/); - - open (FILE, "$_"); - @data = ; - close (FILE); - $count = 0; - foreach $DATARIVI (@data) { - if ($DATARIVI =~ /\@SYNTAX\:(.+)\@/) { - $SYNTAX = join "\n", (grep /^\U$1 /, @lines); - $SYNTAX .= "\n" if $SYNTAX; - $SYNTAX =~ s/ *$//; $SYNTAX =~ s/ *\n/\n/g; - - # add %| after "COMMAND SUB " so parameters will indent correctly - $SYNTAX =~ s/^([A-Z ]+)/\1%|/; - $SYNTAX =~ s/(\n[A-Z ]+)/\1%|/g; - # no need for this if there's no parameters - $SYNTAX =~ s/%\|$//; - $DATARIVI = $SYNTAX; - } elsif ($DATARIVI =~ /^\S+/) { - if ($data[$count+1] =~ /^\S+/) { - chomp $DATARIVI; - $DATARIVI =~ s/ *$//g; - $DATARIVI .= " "; - } - } else { - $DATARIVI =~ s/^\t/ / while ($DATARIVI =~ /^\t/); - } - $count++; - } - - # must always end with empty line - push @data, "\n" if ($data[@data-1] ne "\n"); - push @data, "\n" if ($data[@data-2] !~ /\n$/); - - $newfilename = $_; $newfilename =~ s/\.in$//; - $newfilename =~ s/\/in\//\//; - open (NEWFILE, ">$newfilename"); - print NEWFILE @data; - close (NEWFILE); -} diff --git a/themes/Makefile.am b/themes/Makefile.am new file mode 100644 index 00000000..ad0707c2 --- /dev/null +++ b/themes/Makefile.am @@ -0,0 +1,5 @@ +themedir = $(datadir)/irssi/themes +theme_DATA = default.theme colorless.theme + +EXTRA_DIST = \ + $(theme_DATA) diff --git a/themes/colorless.theme b/themes/colorless.theme new file mode 100644 index 00000000..1b26f628 --- /dev/null +++ b/themes/colorless.theme @@ -0,0 +1,290 @@ +# When testing changes, the easiest way to reload the theme is with /RELOAD. +# This reloads the configuration file too, so if you did any changes remember +# to /SAVE it first. Remember also that /SAVE overwrites the theme file with +# old data so keep backups :) + +# TEMPLATES: + +# The real text formats that irssi uses are the ones you can find with +# /FORMAT command. Back in the old days all the colors and texts were mixed +# up in those formats, and it was really hard to change the colors since you +# might have had to change them in tens of different places. So, then came +# this templating system. + +# Now the /FORMATs don't have any colors in them, and they also have very +# little other styling. Most of the stuff you need to change is in this +# theme file. If you can't change something here, you can always go back +# to change the /FORMATs directly, they're also saved in these .theme files. + +# So .. the templates. They're those {blahblah} parts you see all over the +# /FORMATs and here. Their usage is simply {name parameter1 parameter2}. +# When irssi sees this kind of text, it goes to find "name" from abstracts +# block below and sets "parameter1" into $0 and "parameter2" into $1 (you +# can have more parameters of course). Templates can have subtemplates. +# Here's a small example: +# /FORMAT format hello {colorify {underline world}} +# abstracts = { colorify = "%G$0-%n"; underline = "%U$0-%U"; } +# When irssi expands the templates in "format", the final string would be: +# hello %G%Uworld%U%n +# ie. underlined bright green "world" text. +# and why "$0-", why not "$0"? $0 would only mean the first parameter, +# $0- means all the parameters. With {underline hello world} you'd really +# want to underline both of the words, not just the hello (and world would +# actually be removed entirely). + +# COLORS: + +# You can find definitions for the color format codes in docs/formats.txt. + +# There's one difference here though. %n format. Normally it means the +# default color of the terminal (white mostly), but here it means the +# "reset color back to the one it was in higher template". For example +# if there was /FORMAT test %g{foo}bar, and foo = "%Y$0%n", irssi would +# print yellow "foo" (as set with %Y) but "bar" would be green, which was +# set at the beginning before the {foo} template. If there wasn't the %g +# at start, the normal behaviour of %n would occur. If you _really_ want +# to use the terminal's default color, use %N. + +############################################################################# + +# default foreground color (%N) - -1 is the "default terminal color" +default_color = "-1"; + +# print timestamp/servertag at the end of line, not at beginning +info_eol = "false"; + +# these characters are automatically replaced with specified color +# (dark grey by default) +#replaces = { "[]=" = "%K$*%n"; }; + +abstracts = { + ## + ## generic + ## + + # text to insert at the beginning of each non-message line + line_start = "-!- "; + + # timestamp styling, nothing by default + timestamp = "$*"; + + # any kind of text that needs hilighting, default is to bold + hilight = "%_$*%_"; + + # any kind of error message, default is bright red + error = "%_$*%_"; + + # channel name is printed + channel = "$*"; + + # nick is printed + nick = "$*"; + + # nick host is printed + nickhost = "[$*]"; + + # server name is printed + server = "$*"; + + # some kind of comment is printed + comment = "[$*]"; + + # reason for something is printed (part, quit, kick, ..) + reason = "{comment $*}"; + + # mode change is printed ([+o nick]) + mode = "{comment $*}"; + + ## + ## channel specific messages + ## + + # highlighted nick/host is printed (joins) + channick_hilight = "$*"; + chanhost_hilight = "{nickhost $*}"; + + # nick/host is printed (parts, quits, etc.) + channick = "$*"; + chanhost = "{nickhost $*}"; + + # highlighted channel name is printed + channelhilight = "$*"; + + # ban/ban exception/invite list mask is printed + ban = "$*"; + + ## + ## messages + ## + + # the basic styling of how to print message, $0 = nick mode, $1 = nick + msgnick = "<$0$1-> %|"; + + # message from you is printed. "msgownnick" specifies the styling of the + # nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the + # whole line. + + # Example1: You want the message text to be green: + # ownmsgnick = "{msgnick $0 $1-}%g"; + # Example2.1: You want < and > chars to be yellow: + # ownmsgnick = "%Y{msgnick $0 $1-%Y}%n"; + # (you'll also have to remove <> from replaces list above) + # Example2.2: But you still want to keep <> grey for other messages: + # pubmsgnick = "%K{msgnick $0 $1-%K}%n"; + # pubmsgmenick = "%K{msgnick $0 $1-%K}%n"; + # pubmsghinick = "%K{msgnick $1 $0$2-%n%K}%n"; + # ownprivmsgnick = "%K{msgnick $*%K}%n"; + # privmsgnick = "%K{msgnick %R$*%K}%n"; + + # $0 = nick mode, $1 = nick + ownmsgnick = "{msgnick $0 $1-}"; + ownnick = "$*"; + + # public message in channel, $0 = nick mode, $1 = nick + pubmsgnick = "{msgnick $0 $1-}"; + pubnick = "$*"; + + # public message in channel meant for me, $0 = nick mode, $1 = nick + pubmsgmenick = "{msgnick $0 $1-}"; + menick = "%_$*%_"; + + # public highlighted message in channel + # $0 = highlight color, $1 = nick mode, $2 = nick + pubmsghinick = "{msgnick $1 $0$2-%n}"; + + # channel name is printed with message + msgchannel = ":$*"; + + # private message, $0 = nick, $1 = host + privmsg = "[$0($1-)] "; + + # private message from you, $0 = "msg", $1 = target nick + ownprivmsg = "[$0($1-)] "; + + # own private message in query + ownprivmsgnick = "{msgnick $*}"; + ownprivnick = "$*"; + + # private message in query + privmsgnick = "{msgnick $*}"; + + ## + ## Actions (/ME stuff) + ## + + # used internally by this theme + action_core = " * $*"; + + # generic one that's used by most actions + action = "{action_core $*} "; + + # own action, both private/public + ownaction = "{action $*}"; + + # own action with target, both private/public + ownaction_target = "{action_core $0}:$1 "; + + # private action sent by others + pvtaction = " (*) $* "; + pvtaction_query = "{action $*}"; + + # public action sent by others + pubaction = "{action $*}"; + + + ## + ## other IRC events + ## + + # whois + whois = "%# $[8]0 : $1-"; + + # notices + ownnotice = "[$0($1-)] "; + notice = "-$*- "; + pubnotice_channel = ":$*"; + pvtnotice_host = "($*)"; + servernotice = "!$* "; + + # CTCPs + ownctcp = "[$0($1-)] "; + ctcp = "$*"; + + # wallops + wallop = "$*: "; + wallop_nick = "$*"; + wallop_action = " * $* "; + + # netsplits + netsplit = "$*"; + netjoin = "$*"; + + # /names list + names_prefix = ""; + names_nick = "[$0$1-] "; + names_nick_op = "{names_nick $*}"; + names_nick_halfop = "{names_nick $*}"; + names_nick_voice = "{names_nick $*}"; + names_users = "[$*]"; + names_channel = "$*"; + + # DCC + dcc = "$*"; + dccfile = "$*"; + + # DCC chat, own msg/action + dccownmsg = "[$0($1-)] "; + dccownnick = "$*"; + dccownquerynick = "$*"; + dccownaction = "{action $*}"; + dccownaction_target = "{action_core $0}:$1 "; + + # DCC chat, others + dccmsg = "[$1-($0)] "; + dccquerynick = "$*"; + dccaction = " (*dcc*) $* %|"; + + ## + ## statusbar + ## + + # default background for all statusbars. You can also give + # the default foreground color for statusbar items. + sb_background = "%8"; + + # default backround for "default" statusbar group + #sb_default_bg = "%8"; + # background for prompt / input line + sb_prompt_bg = "%n"; + # background for info statusbar + sb_info_bg = "%8"; + # background for topicbar (same default) + #sb_topic_bg = "%8"; + + # text at the beginning of statusbars. "sb" already puts a space there, + # so we don't use anything by default. + sbstart = ""; + # text at the end of statusbars. Use space so that it's never + # used for anything. + sbend = " "; + + prompt = "[$*] "; + + sb = " [$*]"; + sbmode = "(+$*)"; + sbaway = " (zZzZ)"; + sbservertag = ":$0 (change with ^X)"; + + # activity in statusbar + + # ',' separator + sb_act_sep = "$*"; + # normal text + sb_act_text = "$*"; + # public message + sb_act_msg = "%_$*%_"; + # hilight + sb_act_hilight = "%8$*%8"; + # hilight with specified color, $0 = color, $1 = text + sb_act_hilight_color = "$0$1-%n"; +}; diff --git a/themes/default.theme b/themes/default.theme new file mode 100644 index 00000000..956d7c4f --- /dev/null +++ b/themes/default.theme @@ -0,0 +1,294 @@ +# When testing changes, the easiest way to reload the theme is with /RELOAD. +# This reloads the configuration file too, so if you did any changes remember +# to /SAVE it first. Remember also that /SAVE overwrites the theme file with +# old data so keep backups :) + +# TEMPLATES: + +# The real text formats that irssi uses are the ones you can find with +# /FORMAT command. Back in the old days all the colors and texts were mixed +# up in those formats, and it was really hard to change the colors since you +# might have had to change them in tens of different places. So, then came +# this templating system. + +# Now the /FORMATs don't have any colors in them, and they also have very +# little other styling. Most of the stuff you need to change is in this +# theme file. If you can't change something here, you can always go back +# to change the /FORMATs directly, they're also saved in these .theme files. + +# So .. the templates. They're those {blahblah} parts you see all over the +# /FORMATs and here. Their usage is simply {name parameter1 parameter2}. +# When irssi sees this kind of text, it goes to find "name" from abstracts +# block below and sets "parameter1" into $0 and "parameter2" into $1 (you +# can have more parameters of course). Templates can have subtemplates. +# Here's a small example: +# /FORMAT format hello {colorify {underline world}} +# abstracts = { colorify = "%G$0-%n"; underline = "%U$0-%U"; } +# When irssi expands the templates in "format", the final string would be: +# hello %G%Uworld%U%n +# ie. underlined bright green "world" text. +# and why "$0-", why not "$0"? $0 would only mean the first parameter, +# $0- means all the parameters. With {underline hello world} you'd really +# want to underline both of the words, not just the hello (and world would +# actually be removed entirely). + +# COLORS: + +# You can find definitions for the color format codes in docs/formats.txt. + +# There's one difference here though. %n format. Normally it means the +# default color of the terminal (white mostly), but here it means the +# "reset color back to the one it was in higher template". For example +# if there was /FORMAT test %g{foo}bar, and foo = "%Y$0%n", irssi would +# print yellow "foo" (as set with %Y) but "bar" would be green, which was +# set at the beginning before the {foo} template. If there wasn't the %g +# at start, the normal behaviour of %n would occur. If you _really_ want +# to use the terminal's default color, use %N. + +############################################################################# + +# default foreground color (%N) - -1 is the "default terminal color" +default_color = "-1"; + +# print timestamp/servertag at the end of line, not at beginning +info_eol = "false"; + +# these characters are automatically replaced with specified color +# (dark grey by default) +replaces = { "[]=" = "%K$*%n"; }; + +abstracts = { + ## + ## generic + ## + + # text to insert at the beginning of each non-message line + line_start = "%B-%n!%B-%n "; + + # timestamp styling, nothing by default + timestamp = "$*"; + + # any kind of text that needs hilighting, default is to bold + hilight = "%_$*%_"; + + # any kind of error message, default is bright red + error = "%R$*%n"; + + # channel name is printed + channel = "%_$*%_"; + + # nick is printed + nick = "%_$*%_"; + + # nick host is printed + nickhost = "[$*]"; + + # server name is printed + server = "%_$*%_"; + + # some kind of comment is printed + comment = "[$*]"; + + # reason for something is printed (part, quit, kick, ..) + reason = "{comment $*}"; + + # mode change is printed ([+o nick]) + mode = "{comment $*}"; + + ## + ## channel specific messages + ## + + # highlighted nick/host is printed (joins) + channick_hilight = "%C$*%n"; + chanhost_hilight = "{nickhost %c$*%n}"; + + # nick/host is printed (parts, quits, etc.) + channick = "%c$*%n"; + chanhost = "{nickhost $*}"; + + # highlighted channel name is printed + channelhilight = "%c$*%n"; + + # ban/ban exception/invite list mask is printed + ban = "%c$*%n"; + + ## + ## messages + ## + + # the basic styling of how to print message, $0 = nick mode, $1 = nick + msgnick = "%K<%n$0$1-%K>%n %|"; + + # message from you is printed. "ownnick" specifies the styling of the + # nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the + # whole line. + + # Example1: You want the message text to be green: + # ownmsgnick = "{msgnick $0 $1-}%g"; + # Example2.1: You want < and > chars to be yellow: + # ownmsgnick = "%Y{msgnick $0 $1-%Y}%n"; + # (you'll also have to remove <> from replaces list above) + # Example2.2: But you still want to keep <> grey for other messages: + # pubmsgnick = "%K{msgnick $0 $1-%K}%n"; + # pubmsgmenick = "%K{msgnick $0 $1-%K}%n"; + # pubmsghinick = "%K{msgnick $1 $0$2-%n%K}%n"; + # ownprivmsgnick = "%K{msgnick $*%K}%n"; + # privmsgnick = "%K{msgnick %R$*%K}%n"; + + # $0 = nick mode, $1 = nick + ownmsgnick = "{msgnick $0 $1-}"; + ownnick = "%_$*%n"; + + # public message in channel, $0 = nick mode, $1 = nick + pubmsgnick = "{msgnick $0 $1-}"; + pubnick = "%N$*%n"; + + # public message in channel meant for me, $0 = nick mode, $1 = nick + pubmsgmenick = "{msgnick $0 $1-}"; + menick = "%Y$*%n"; + + # public highlighted message in channel + # $0 = highlight color, $1 = nick mode, $2 = nick + pubmsghinick = "{msgnick $1 $0$2-%n}"; + + # channel name is printed with message + msgchannel = "%K:%c$*%n"; + + # private message, $0 = nick, $1 = host + privmsg = "[%R$0%K(%r$1-%K)%n] "; + + # private message from you, $0 = "msg", $1 = target nick + ownprivmsg = "[%r$0%K(%R$1-%K)%n] "; + + # own private message in query + ownprivmsgnick = "{msgnick $*}"; + ownprivnick = "%_$*%n"; + + # private message in query + privmsgnick = "{msgnick %R$*%n}"; + + ## + ## Actions (/ME stuff) + ## + + # used internally by this theme + action_core = "%_ * $*%n"; + + # generic one that's used by most actions + action = "{action_core $*} "; + + # own action, both private/public + ownaction = "{action $*}"; + + # own action with target, both private/public + ownaction_target = "{action_core $0}%K:%c$1%n "; + + # private action sent by others + pvtaction = "%_ (*) $*%n "; + pvtaction_query = "{action $*}"; + + # public action sent by others + pubaction = "{action $*}"; + + + ## + ## other IRC events + ## + + # whois + whois = "%# $[8]0 : $1-"; + + # notices + ownnotice = "[%r$0%K(%R$1-%K)]%n "; + notice = "%K-%M$*%K-%n "; + pubnotice_channel = "%K:%m$*"; + pvtnotice_host = "%K(%m$*%K)"; + servernotice = "%g!$*%n "; + + # CTCPs + ownctcp = "[%r$0%K(%R$1-%K)] "; + ctcp = "%g$*%n"; + + # wallops + wallop = "%_$*%n: "; + wallop_nick = "%n$*"; + wallop_action = "%_ * $*%n "; + + # netsplits + netsplit = "%R$*%n"; + netjoin = "%C$*%n"; + + # /names list + names_prefix = ""; + names_nick = "[%_$0%_$1-] "; + names_nick_op = "{names_nick $*}"; + names_nick_halfop = "{names_nick $*}"; + names_nick_voice = "{names_nick $*}"; + names_users = "[%g$*%n]"; + names_channel = "%G$*%n"; + + # DCC + dcc = "%g$*%n"; + dccfile = "%_$*%_"; + + # DCC chat, own msg/action + dccownmsg = "[%r$0%K($1-%K)%n] "; + dccownnick = "%R$*%n"; + dccownquerynick = "%_$*%n"; + dccownaction = "{action $*}"; + dccownaction_target = "{action_core $0}%K:%c$1%n "; + + # DCC chat, others + dccmsg = "[%G$1-%K(%g$0%K)%n] "; + dccquerynick = "%G$*%n"; + dccaction = "%_ (*dcc*) $*%n %|"; + + ## + ## statusbar + ## + + # default background for all statusbars. You can also give + # the default foreground color for statusbar items. + sb_background = "%4%w"; + + # default backround for "default" statusbar group + #sb_default_bg = "%4"; + # background for prompt / input line + sb_prompt_bg = "%n"; + # background for info statusbar + sb_info_bg = "%8"; + # background for topicbar (same default) + #sb_topic_bg = "%4"; + + # text at the beginning of statusbars. "sb" already puts a space there, + # so we don't use anything by default. + sbstart = ""; + # text at the end of statusbars. Use space so that it's never + # used for anything. + sbend = " "; + + topicsbstart = "{sbstart $*}"; + topicsbend = "{sbend $*}"; + + prompt = "[$*] "; + + sb = " %c[%n$*%c]%n"; + sbmode = "(%c+%n$*)"; + sbaway = " (%GzZzZ%n)"; + sbservertag = ":$0 (change with ^X)"; + sbnickmode = "$0"; + + # activity in statusbar + + # ',' separator + sb_act_sep = "%c$*"; + # normal text + sb_act_text = "%c$*"; + # public message + sb_act_msg = "%W$*"; + # hilight + sb_act_hilight = "%M$*"; + # hilight with specified color, $0 = color, $1 = text + sb_act_hilight_color = "$0$1-%n"; +}; diff --git a/utils/Makefile.am b/utils/Makefile.am new file mode 100644 index 00000000..be24c17f --- /dev/null +++ b/utils/Makefile.am @@ -0,0 +1,4 @@ +EXTRA_DIST = \ + file2header.sh \ + irssi-version.sh \ + syntax.pl diff --git a/utils/file2header.sh b/utils/file2header.sh new file mode 100755 index 00000000..f25ae13b --- /dev/null +++ b/utils/file2header.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +echo "const char *$2 =" +cat $1|sed 's/\\/\\\\/g'|sed 's/"/\\"/g'|sed 's/^/\"/'|sed 's/$/\\n\"/' +echo ";" diff --git a/utils/irssi-version.sh b/utils/irssi-version.sh new file mode 100755 index 00000000..1fc6a558 --- /dev/null +++ b/utils/irssi-version.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +DATE=`GIT_DIR=$1/.git git log -1 --pretty=format:%ai HEAD` + +VERSION_DATE=`echo $DATE | cut -f 1 -d ' ' | tr -d -` +VERSION_TIME=`echo $DATE | cut -f 2 -d ' ' | awk -F: '{printf "%d", $1$2}'` + +if test -z "$VERSION_DATE"; then + exec>&2 + echo "**Error**: `basename "$0"` must be run in a git clone, cannot proceed." + exit 1 +fi + +echo "#define IRSSI_VERSION_DATE $VERSION_DATE" +echo "#define IRSSI_VERSION_TIME $VERSION_TIME" + +if echo "${VERSION}" | grep -q -- -head; then + # -head version, get extra details from git if we can + git_version=$(GIT_DIR=$1/.git git describe --dirty --long --always --tags) + if [ $? = 0 ]; then + new_version="$(echo "${VERSION}" | sed 's/-head//')" + # Because the git tag won't yet include the next release we modify the git + # describe output using the version defined from configure.ac. + version="${new_version}-$(echo "${git_version}" | sed 's/^.*-[0-9]\+-//')" + echo "#undef PACKAGE_VERSION" + echo "#define PACKAGE_VERSION \"${version}\"" + fi +fi diff --git a/utils/syncdocs.sh b/utils/syncdocs.sh new file mode 100755 index 00000000..e723edd2 --- /dev/null +++ b/utils/syncdocs.sh @@ -0,0 +1,102 @@ +#!/bin/sh -e +# Run this to download FAQ and startup-HOWTO from irssi.org + +PKG_NAME="Irssi" + +site=https://irssi.org + +faq=$site/documentation/faq/ +howto=$site/documentation/startup/ + +# remove everything until H1 and optionally 2 DIVs before the +# FOOTER. May need to be adjusted as the source pages change +pageclean_regex='s{.*(?=\s*)?(\s*)?)}{\1\2}g;' + +srcdir=`dirname "$0"` +test -z "$srcdir" && srcdir=. +srcdir="$srcdir"/.. + +if test ! -f "$srcdir"/configure.ac; then + echo -n "**Error**: Directory \`$srcdir' does not look like the" + echo " top-level $PKG_NAME directory" + exit 1 +fi + +# detect downloader app +downloader=false + +if type curl >/dev/null 2>&1 ; then + downloader="curl -Ssf" +elif type wget >/dev/null 2>&1 ; then + downloader="wget -nv -O-" +else + echo "**Error**: No wget or curl present" + echo "Install wget or curl, then run syncdocs.sh again" +fi + +# detect html converter app +converter=false +if [ "$1" = "-any" ]; then + any=true +else + any=false +fi + +if type w3m >/dev/null 2>&1 ; then + converter="w3m -o display_link_number=1 -dump -T text/html" + any=true +elif type lynx >/dev/null 2>&1 ; then + converter="lynx -dump -stdin -force_html" +elif type elinks >/dev/null 2>&1 ; then + converter="elinks -dump -force-html" +else + echo "**Error**: Neither w3m, nor lynx or elinks present" + echo "Install w3m, then run syncdocs.sh again" + exit 1 +fi + +if ! $any ; then + echo "**Error**: w3m not present" + echo "If you want to use lynx or elinks, run syncdocs.sh -any" + exit 1 +fi + +check_download() { + if test "$1" -ne 0 || test ! -e "$2" || test "$(wc -l "$2" | awk '{print $1}')" -le 1 ; then + rm -f "$2" + echo "... download failed ( $1 )" + exit 2 + fi +} + +download_it() { + echo "Downloading $1 from $2 ..." + ret=0 + $downloader "$2" > "$3".tmp || ret=$? + check_download "$ret" "$3".tmp + perl -i -0777 -p -e "$pageclean_regex" "$3".tmp + perl -i -0777 -p -e 's{\A}{'""'\n}' "$3".tmp + perl -i -0777 -p -e 's{\[email protected\]}{user\@host}g' "$3".tmp + mv "$3".tmp "$3" +} + +download_it "FAQ" "$faq" "$srcdir"/docs/faq.html +download_it "Startup How-To" "$howto" "$srcdir"/docs/startup-HOWTO.html + +# .html -> .txt with lynx or elinks +echo "Documentation: html -> txt..." + +cat "$srcdir"/docs/faq.html \ + | LC_ALL=en_IE.utf8 $converter \ + | perl -pe ' + s/^ *//; + if ($_ eq "\n" && $state eq "Q") { $_ = ""; } + elsif (/^([QA]):/) { $state = $1 } + elsif ($_ ne "\n") { $_ = " $_"; }; +' > "$srcdir"/docs/faq.txt + +cat "$srcdir"/docs/startup-HOWTO.html \ + | perl -pe "s/\\bhref=([\"\'])#.*?\\1//" \ + | LC_ALL=en_IE.utf8 $converter > "$srcdir"/docs/startup-HOWTO.txt diff --git a/utils/syncscripts.sh b/utils/syncscripts.sh new file mode 100755 index 00000000..533b77cc --- /dev/null +++ b/utils/syncscripts.sh @@ -0,0 +1,39 @@ +#!/bin/sh -e +# Run this script to sync dual lived scripts from scripts.irssi.org to scripts/ + +PKG_NAME="Irssi" + +scriptbase=https://scripts.irssi.org/scripts + +srcdir=`dirname "$0"` +test -z "$srcdir" && srcdir=. +srcdir="$srcdir"/.. + +if test ! -f "$srcdir"/configure.ac; then + echo -n "**Error**: Directory \`$srcdir' does not look like the" + echo " top-level $PKG_NAME directory" + exit 1 +fi + +dl2='curl -Ssf' + +dl_it() { + echo "$1" + $dl2 -o "$srcdir/scripts/$1" "$scriptbase/$1" +} + +for script in \ + autoop.pl \ + autorejoin.pl \ + buf.pl \ + dns.pl \ + kills.pl \ + mail.pl \ + mlock.pl \ + quitmsg.pl \ + scriptassist.pl \ + usercount.pl \ + ; +do + dl_it $script +done diff --git a/utils/syntax.pl b/utils/syntax.pl new file mode 100755 index 00000000..33bd12b4 --- /dev/null +++ b/utils/syntax.pl @@ -0,0 +1,80 @@ +#!/usr/bin/perl +# +# This script reads the syntaces of commands from irssi source tree. +# Then it browses through all '.in' files in the current directory and +# substitutes '@SYNTAX:foo@' tags with real syntaces found. This data +# is written into the corresponding files without the '.in' extension. +# For example: help.in -> ../help +# +# This path has to be changed. It should point to your irssi/src directory +# Remember to include the asterisk ('*'). +$SRC_PATH='src'; + +@files = sort `find src -name '*.c'`; + +foreach $file (@files) { + open (FILE, "$file"); + while () { + chomp; + if (m!/\*.SYNTAX\:! || $state) { + s/^\s+/ /; + s/.*SYNTAX: //; + if (/^ [A-Z]+/) { + push @lines, $line; + $line = ""; + s/^ //; + } + $line .= $_; + if (m!\*/!) { + $line =~ s!\*/!!; + push @lines, $line; + $line = ""; + $state = 0; + } else { + $state = 1; + } + } + } + close (FILE); +} +while () { + next if (/Makefile/); + + open (FILE, "$_"); + @data = ; + close (FILE); + $count = 0; + foreach $DATARIVI (@data) { + if ($DATARIVI =~ /\@SYNTAX\:(.+)\@/) { + $SYNTAX = join "\n", (grep /^\U$1 /, @lines); + $SYNTAX .= "\n" if $SYNTAX; + $SYNTAX =~ s/ *$//; $SYNTAX =~ s/ *\n/\n/g; + + # add %| after "COMMAND SUB " so parameters will indent correctly + $SYNTAX =~ s/^([A-Z ]+)/\1%|/; + $SYNTAX =~ s/(\n[A-Z ]+)/\1%|/g; + # no need for this if there's no parameters + $SYNTAX =~ s/%\|$//; + $DATARIVI = $SYNTAX; + } elsif ($DATARIVI =~ /^\S+/) { + if ($data[$count+1] =~ /^\S+/) { + chomp $DATARIVI; + $DATARIVI =~ s/ *$//g; + $DATARIVI .= " "; + } + } else { + $DATARIVI =~ s/^\t/ / while ($DATARIVI =~ /^\t/); + } + $count++; + } + + # must always end with empty line + push @data, "\n" if ($data[@data-1] ne "\n"); + push @data, "\n" if ($data[@data-2] !~ /\n$/); + + $newfilename = $_; $newfilename =~ s/\.in$//; + $newfilename =~ s/\/in\//\//; + open (NEWFILE, ">$newfilename"); + print NEWFILE @data; + close (NEWFILE); +} -- cgit v1.2.3