chiark / gitweb /
chiarks, on mariner
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 13 Jun 2016 11:08:13 +0000 (12:08 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 13 Jun 2016 11:08:13 +0000 (12:08 +0100)
dot/configs/chiarks [new file with mode: 0755]
dot/configs/xclients
scripts/xterm-CT [new file with mode: 0755]

diff --git a/dot/configs/chiarks b/dot/configs/chiarks
new file mode 100755 (executable)
index 0000000..14df3d6
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+eval `cd $HOME && .configs/configure`
+
+# ssh -L 6667:chiark:6667 -L 3128:chiark:3128 ijackson@chiark.greenend.org.uk sleep 604800 </dev/null &
+
+case "$1" in
+-q)    exit 0;;
+'')    ;;
+*)     echo >&2 'usage: .../chiarks [-q]'; exit 1;;
+esac
+
+for x in 3 2 1
+do
+       sz=80x55
+       y=$(( 35*$x+100+$pixels_y ))
+       xb=$(( (($pixels_x-503)*(3-$x))/2 ))
+       xterm-CT "chiark ssh #$x" -geometry $sz+$xb+$y \
+               -e ssh tunnel.chiark.greenend.org.uk -l ijackson &
+       echo -n :
+#      xterm-CT "chiark ssh ian #$x" -geometry $sz+$(( $pixels_x + $xb ))+$y \
+#              -e ssh tunnel.chiark.greenend.org.uk -l ian &
+#      echo -n :
+done
index 81ea9a7..73764fb 100755 (executable)
@@ -23,8 +23,11 @@ mate-power-manager &
 (sleep 1; exec nm-applet) &
 
 
-.configs/chiarks
-
+case "$(hostname)" in
+mariner)
+        .configs/chiarks
+        ;;
+esac
 
 #
 #if test -d /proc/acpi/battery; then
diff --git a/scripts/xterm-CT b/scripts/xterm-CT
new file mode 100755 (executable)
index 0000000..15e8d7c
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+set -e
+titlebase="$1"
+shift
+touch "$HOME/.counters/l.$DISPLAY"
+newcount=`with-lock-ex -w "$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 (<X>) {
+               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']' "$@"