From: ian Date: Thu, 19 Jul 2001 20:19:04 +0000 (+0000) Subject: Found xterm-CT X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=98b8669674c5dac80c518ea41fd59a3657bcbf6e;hp=8fb78f857f03cbd75c56bf11c367c861dcc00e0b;p=ian-dotfiles.git Found xterm-CT --- diff --git a/files/personal_scripts_bin_xterm-CT b/files/personal_scripts_bin_xterm-CT new file mode 100755 index 0000000..1f2c411 --- /dev/null +++ b/files/personal_scripts_bin_xterm-CT @@ -0,0 +1,24 @@ +#!/bin/sh +set -e +titlebase="$1" +shift +touch "$HOME/.counters/l.$DISPLAY" +newcount=`with-lock-wait "$HOME/.counters/l.$DISPLAY" perl -e ' + chdir($ARGV[2]) or die $!; + $tb= unpack("H*",$ARGV[1]); $found=0; + open(X,"v.$ARGV[0]\0") or die $!; + open(Z,">n.$ARGV[0]\0") or die $!; + while () { + if (m/^(\d+) $tb$/o && !$found++) { + $nx= $1+1; + } else { + print Z "$_" or die $!; + } + } + if (!defined($nx)) { $nx= 1; } + print Z "$nx $tb\n" or die $!; + close(Z) or die $!; + rename("n.$ARGV[0]","v.$ARGV[0]") or die $!; + print "$nx\n"; +' "$DISPLAY" "$titlebase" "$HOME/.counters"` +exec xterm -T "$titlebase"' ['$newcount']' "$@"