summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/completer.zsh4
-rwxr-xr-xetc/countmail67
-rw-r--r--etc/etcscreenrc16
-rw-r--r--etc/screenrc12
-rwxr-xr-xetc/toolcheck4
5 files changed, 87 insertions, 16 deletions
diff --git a/etc/completer.zsh b/etc/completer.zsh
index f8f0c96..bbbd01c 100644
--- a/etc/completer.zsh
+++ b/etc/completer.zsh
@@ -45,9 +45,9 @@ case $state in
# Complete folder names.
local screendir
- screendir=(`screen -ls | grep Socket | tail -1 | sed -e 's/\.$//' | awk '{print $NF;}'`)
+ screendir=(`screen -ls | grep Socket | sed -n -e 's/\.$//' -e '$p' | awk '{print $NF;}'`)
_wanted files expl 'screen process' _path_files -W screendir
;;
esac
- \ No newline at end of file
+
diff --git a/etc/countmail b/etc/countmail
new file mode 100755
index 0000000..974f143
--- /dev/null
+++ b/etc/countmail
@@ -0,0 +1,67 @@
+#!/usr/bin/perl
+
+sub countmsgs {
+ return -1 unless open(M, "<$mbox");
+ my $inhdr = 0;
+ my $cl = undef;
+ my $msgread = 0;
+ my $count = 0;
+ while(<M>) {
+ if (!$inhdr && /^From\s+\S+\s+(?i:sun|mon|tue|wed|thu|fri|sat)\s+(?i:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\s+\d+\s/) {
+ $inhdr = 1;
+ $msgread = 0;
+ undef $cl;
+ next;
+ }
+ if ($inhdr) {
+ if (/^content-length:\s+(\d+)/i) {
+ $cl = 0+$1;
+ next;
+ }
+ if (/^status:\s+(\S)/i) {
+ $msgread = 1 unless $1 eq 'N' || $1 eq 'U';
+ next;
+ }
+ if ($_ eq "\n") {
+ $count++ if !$msgread;
+ seek(M, $cl, 1) if defined $cl;
+ $inhdr = 0;
+ }
+ }
+ }
+ close M;
+ return $count;
+}
+
+$| = 1;
+$mbox = $ARGV[0] || $ENV{'MAIL'};
+$oldfmt = $ARGV[1] || "%4d ";
+$newfmt = $ARGV[2] || "\005{Rk}%4d \005{-}";
+
+@oldstat = stat($mbox);
+if (!@oldstat) {
+ print "\005{Rk} ??? \005{-}\n";
+ exit 1;
+}
+$oldcount = 0;
+while(1) {
+ $count = countmsgs($mbox);
+ if ($count == -1) {
+ print "\005{Rk} ??? \005{-}\n";
+ } elsif ($count < $oldcount || $count == 0) {
+ printf "$oldfmt\n", $count;
+ } else {
+ printf "$newfmt\n", $count;
+ }
+ $oldcount = $count;
+ while (1) {
+ @newstat = stat($mbox);
+ if (!@newstat) {
+ print "\005{Rk} ??? \005{-}\n";
+ exit 1;
+ }
+ last if $newstat[7] != $oldstat[7] || $newstat[9] != $oldstat[9];
+ sleep 1;
+ }
+ @oldstat = @newstat;
+}
diff --git a/etc/etcscreenrc b/etc/etcscreenrc
index 83a4a41..3fc9c37 100644
--- a/etc/etcscreenrc
+++ b/etc/etcscreenrc
@@ -82,13 +82,13 @@ termcap wy75-42 nx:xo:Z0=\E[?3h\E[31h:Z1=\E[?3l\E[31h
terminfo wy75-42 nx:xo:Z0=\E[?3h\E[31h:Z1=\E[?3l\E[31h
#remove some stupid / dangerous key bindings
-bind '^k'
-#bind 'L'
-bind '^\'
+bind ^k
+#bind L
+bind ^\
#make them better
-bind '\\' quit
-bind 'K' kill
-bind 'I' login on
-bind 'O' login off
-bind '}' history
+bind \\ quit
+bind K kill
+bind I login on
+bind O login off
+bind } history
diff --git a/etc/screenrc b/etc/screenrc
index 716d86f..ca6561d 100644
--- a/etc/screenrc
+++ b/etc/screenrc
@@ -35,6 +35,9 @@ defscrollback 1000
# don't kill window after the process died
# zombie "^["
+# enable support for the "alternate screen" capability in all windows
+# altscreen on
+
################
#
# xterm tweaks
@@ -133,8 +136,8 @@ bind ^] paste [.]
#
# screen -t local 0
-# screen -t mail 1 elm
-# screen -t 40 2 rlogin faui40
+# screen -t mail 1 mutt
+# screen -t 40 2 rlogin server
# caption always "%3n %t%? @%u%?%? [%h]%?%=%c"
# hardstatus alwaysignore
@@ -145,5 +148,6 @@ bind ^] paste [.]
# bind - resize -1
# bind _ resize max
#
-# attrcolor u "-u b"
-# attrcolor b "R"
+# defnonblock 1
+# blankerprg rain -d 100
+# idle 30 blanker
diff --git a/etc/toolcheck b/etc/toolcheck
index 747e9a0..1b8ee39 100755
--- a/etc/toolcheck
+++ b/etc/toolcheck
@@ -5,7 +5,7 @@
# 24.7.95 jw.
retval=0
-reply="`sh -version 2>&1 < /dev/null | head -1`"
+reply="`sh -version 2>&1 < /dev/null | sed q`"
case "$reply" in
GNU*1.14.3*)
echo "- sh is '$reply'";
@@ -21,7 +21,7 @@ case "$reply" in
*) ;;
esac
-reply="`sed --version 2>&1 < /dev/null | head -1`"
+reply="`sed --version 2>&1 < /dev/null | sed q`"
case "$reply" in
GNU\ sed\ version\ 2.0[34])
echo "- sed is '$reply'";