From 556f0596b096919a56c518e76d9d59aab70a521c Mon Sep 17 00:00:00 2001 From: Stas Degteff Date: Wed, 10 Nov 2010 04:53:55 +0000 Subject: [PATCH] Use screen utility (if exist in system) for workaround for russian language on UTF-8 terminal --- bin/golded | 19 +++++++++++++++++-- bin/screenrc_koi8r | 13 +++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 bin/screenrc_koi8r diff --git a/bin/golded b/bin/golded index 81b93b2..f0f2ab3 100644 --- a/bin/golded +++ b/bin/golded @@ -1,6 +1,21 @@ #!/bin/sh # run this file to launch GoldEd # it also contains workaround for Russian language in UTF-8 encoding +# $Id$ + +CMD="gedlnx $*" +SCREENRC_GOLDED="/usr/share/golded-plus/screenrc_koi8r" +SCREEN=`which screen` +LUIT=`which luit` +if [ -n $SCREEN ]; then + CMD_UTF8="$SCREEN -c ${SCREENRC_GOLDED}" +else if [ -n "$LUIT" ]; then + CMD_UTF8="$LUIT -x -encoding koi8-r -- $CMD" + else + CMD_UTF8=$CMD + fi +fi + echo "$LC_ALL $LC_CTYPE $LANG" | grep -q "ru_RU.UTF-8" \ - && (export LC_ALL="ru_RU.KOI8-R"; exec luit -x -encoding koi8-r -- gedlnx $*) \ - || exec gedlnx $* + && (export LC_ALL="ru_RU.KOI8-R"; exec $CMD_UTF8) \ + || exec $CMD diff --git a/bin/screenrc_koi8r b/bin/screenrc_koi8r new file mode 100644 index 0000000..6cd66d2 --- /dev/null +++ b/bin/screenrc_koi8r @@ -0,0 +1,13 @@ +# $Id$ +# This configuration file for the screen utility containis workaround +# for Russian language on UTF-8 terminal (console) locale +# Also this configuration run mailer (binkd in client mode) in background window +# for parallel mail transfer + +startup_message off +# Set default encoding for new windows +defencoding koi8-r +# Exec mailer in first window +screen /bin/sh -c "binkd -c ~/fido/etc/binkd.conf" +# Exec Golded+ in foreground window +screen /bin/sh -c "LANG=ru_RU.KOI8-R gedlnx"