From ccd9a2392417e22f770ba7d7eec7cfc5d997a799 Mon Sep 17 00:00:00 2001
From: Iain Patterson <me@iain.cx>
Date: Wed, 22 Aug 2007 10:04:28 +0000
Subject: [PATCH] Imported colours and scripts.

git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@65 6be0d1a5-5cfe-0310-89b6-964be062b18b
---
 .bash_profile                                  |  0
 .inputrc                                       |  0
 .ssh/colours/cambridge.iain.cx$                |  1 +
 .ssh/colours/furryclan.net$                    |  1 +
 .ssh/hosts/iain.cx/aygalades.cambridge.iain.cx |  2 ++
 .vimrc                                         |  0
 .xbindkeys/39                                  |  1 +
 .xbindkeys/49                                  |  1 +
 .xbindkeys/colours/Birmingham:#220044          | 25 +++++++++++++++++++++++++
 .xbindkeys/colours/Black                       | 25 +++++++++++++++++++++++++
 .xbindkeys/colours/Blue                        | 25 +++++++++++++++++++++++++
 .xbindkeys/colours/Blue:#2040c0                | 25 +++++++++++++++++++++++++
 .xbindkeys/colours/Brown:#a06000               | 25 +++++++++++++++++++++++++
 .xbindkeys/colours/CacheLogic:#2569d9          | 25 +++++++++++++++++++++++++
 .xbindkeys/colours/DarkBlue                    | 25 +++++++++++++++++++++++++
 .xbindkeys/colours/DarkGreen                   | 25 +++++++++++++++++++++++++
 .xbindkeys/colours/DarkGreen:#004000           | 25 +++++++++++++++++++++++++
 .xbindkeys/colours/DarkPurple:#604060          | 25 +++++++++++++++++++++++++
 .xbindkeys/colours/DarkRed                     | 25 +++++++++++++++++++++++++
 .xbindkeys/colours/DarkRed:#400000             | 25 +++++++++++++++++++++++++
 .xbindkeys/colours/Green                       | 25 +++++++++++++++++++++++++
 .xbindkeys/colours/Grey                        | 25 +++++++++++++++++++++++++
 .xbindkeys/colours/Orange                      | 25 +++++++++++++++++++++++++
 .xbindkeys/colours/Purple                      | 25 +++++++++++++++++++++++++
 .xbindkeys/colours/Red                         | 25 +++++++++++++++++++++++++
 .xbindkeys/colours/Vim:#000040                 | 25 +++++++++++++++++++++++++
 .xbindkeys/colours/White                       | 25 +++++++++++++++++++++++++
 .xbindkeys/leftclick                           |  2 ++
 .xbindkeys/lock                                |  1 +
 .xbindkeys/title                               |  7 +++++++
 .xbindkeysrc                                   |  4 ++++
 lensort                                        | 13 +++++++++++++
 sshcolourterm                                  | 26 ++++++++++++++++++++++++++
 sshterm                                        |  7 +++++++
 usize                                          | 10 ++++++++++
 35 files changed, 551 insertions(+)
 mode change 100755 => 100644 .bash_profile
 mode change 100755 => 100644 .inputrc
 create mode 120000 .ssh/colours/cambridge.iain.cx$
 create mode 120000 .ssh/colours/furryclan.net$
 create mode 100755 .ssh/hosts/iain.cx/aygalades.cambridge.iain.cx
 mode change 100755 => 100644 .vimrc
 create mode 120000 .xbindkeys/39
 create mode 120000 .xbindkeys/49
 create mode 100755 .xbindkeys/colours/Birmingham:#220044
 create mode 100755 .xbindkeys/colours/Black
 create mode 100755 .xbindkeys/colours/Blue
 create mode 100755 .xbindkeys/colours/Blue:#2040c0
 create mode 100755 .xbindkeys/colours/Brown:#a06000
 create mode 100755 .xbindkeys/colours/CacheLogic:#2569d9
 create mode 100755 .xbindkeys/colours/DarkBlue
 create mode 100755 .xbindkeys/colours/DarkGreen
 create mode 100755 .xbindkeys/colours/DarkGreen:#004000
 create mode 100755 .xbindkeys/colours/DarkPurple:#604060
 create mode 100755 .xbindkeys/colours/DarkRed
 create mode 100755 .xbindkeys/colours/DarkRed:#400000
 create mode 100755 .xbindkeys/colours/Green
 create mode 100755 .xbindkeys/colours/Grey
 create mode 100755 .xbindkeys/colours/Orange
 create mode 100755 .xbindkeys/colours/Purple
 create mode 100755 .xbindkeys/colours/Red
 create mode 100755 .xbindkeys/colours/Vim:#000040
 create mode 100755 .xbindkeys/colours/White
 create mode 100644 .xbindkeys/leftclick
 create mode 100755 .xbindkeys/lock
 create mode 100755 .xbindkeys/title
 create mode 100644 .xbindkeysrc
 create mode 100755 lensort
 create mode 100755 sshcolourterm
 create mode 100755 sshterm
 create mode 100755 usize

diff --git a/.bash_profile b/.bash_profile
old mode 100755
new mode 100644
diff --git a/.inputrc b/.inputrc
old mode 100755
new mode 100644
diff --git a/.ssh/colours/cambridge.iain.cx$ b/.ssh/colours/cambridge.iain.cx$
new file mode 120000
index 0000000..d3c3d42
--- /dev/null
+++ b/.ssh/colours/cambridge.iain.cx$
@@ -0,0 +1 @@
+DarkRed:#400000
\ No newline at end of file
diff --git a/.ssh/colours/furryclan.net$ b/.ssh/colours/furryclan.net$
new file mode 120000
index 0000000..ee9ee8b
--- /dev/null
+++ b/.ssh/colours/furryclan.net$
@@ -0,0 +1 @@
+Brown:#a06000
\ No newline at end of file
diff --git a/.ssh/hosts/iain.cx/aygalades.cambridge.iain.cx b/.ssh/hosts/iain.cx/aygalades.cambridge.iain.cx
new file mode 100755
index 0000000..d394b13
--- /dev/null
+++ b/.ssh/hosts/iain.cx/aygalades.cambridge.iain.cx
@@ -0,0 +1,2 @@
+#!/bin/bash
+exec sshterm $(basename "$0")
diff --git a/.vimrc b/.vimrc
old mode 100755
new mode 100644
diff --git a/.xbindkeys/39 b/.xbindkeys/39
new file mode 120000
index 0000000..c5f7552
--- /dev/null
+++ b/.xbindkeys/39
@@ -0,0 +1 @@
+colours
\ No newline at end of file
diff --git a/.xbindkeys/49 b/.xbindkeys/49
new file mode 120000
index 0000000..c5f7552
--- /dev/null
+++ b/.xbindkeys/49
@@ -0,0 +1 @@
+colours
\ No newline at end of file
diff --git a/.xbindkeys/colours/Birmingham:#220044 b/.xbindkeys/colours/Birmingham:#220044
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/Birmingham:#220044
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/colours/Black b/.xbindkeys/colours/Black
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/Black
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/colours/Blue b/.xbindkeys/colours/Blue
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/Blue
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/colours/Blue:#2040c0 b/.xbindkeys/colours/Blue:#2040c0
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/Blue:#2040c0
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/colours/Brown:#a06000 b/.xbindkeys/colours/Brown:#a06000
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/Brown:#a06000
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/colours/CacheLogic:#2569d9 b/.xbindkeys/colours/CacheLogic:#2569d9
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/CacheLogic:#2569d9
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/colours/DarkBlue b/.xbindkeys/colours/DarkBlue
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/DarkBlue
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/colours/DarkGreen b/.xbindkeys/colours/DarkGreen
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/DarkGreen
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/colours/DarkGreen:#004000 b/.xbindkeys/colours/DarkGreen:#004000
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/DarkGreen:#004000
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/colours/DarkPurple:#604060 b/.xbindkeys/colours/DarkPurple:#604060
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/DarkPurple:#604060
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/colours/DarkRed b/.xbindkeys/colours/DarkRed
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/DarkRed
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/colours/DarkRed:#400000 b/.xbindkeys/colours/DarkRed:#400000
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/DarkRed:#400000
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/colours/Green b/.xbindkeys/colours/Green
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/Green
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/colours/Grey b/.xbindkeys/colours/Grey
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/Grey
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/colours/Orange b/.xbindkeys/colours/Orange
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/Orange
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/colours/Purple b/.xbindkeys/colours/Purple
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/Purple
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/colours/Red b/.xbindkeys/colours/Red
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/Red
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/colours/Vim:#000040 b/.xbindkeys/colours/Vim:#000040
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/Vim:#000040
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/colours/White b/.xbindkeys/colours/White
new file mode 100755
index 0000000..abe73a9
--- /dev/null
+++ b/.xbindkeys/colours/White
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Script to send keystrokes to urxvt to set foreground or background colours.
+# Usage: $SOME_PATH/<fgbg>/<colour>
+# Notes: fgbg should be 39 (foreground) or 49 (background).
+#        colour should be a colour name or a hex code or a string name:#hex
+#        Create a hardlink to the script with the name of a new colour.
+# Example: 39/Blue
+#          49/#2569d9
+#          49/CacheLogic:#2569d9
+#
+
+# Find the type by checking which dir we're in and extracting the 39/49 part.
+dir=$(dirname $0)
+fgbg=$(basename $dir)
+
+# Find the desired colour by looking at this script's name.
+colour=$(basename $0)
+colour=${colour#*:}
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]$fgbg;$colour\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeys/leftclick b/.xbindkeys/leftclick
new file mode 100644
index 0000000..4dcc39e
--- /dev/null
+++ b/.xbindkeys/leftclick
@@ -0,0 +1,2 @@
+ButtonPress 1
+ButtonRelease 1
diff --git a/.xbindkeys/lock b/.xbindkeys/lock
new file mode 100755
index 0000000..835eb23
--- /dev/null
+++ b/.xbindkeys/lock
@@ -0,0 +1 @@
+xscreensaver-command -lock
diff --git a/.xbindkeys/title b/.xbindkeys/title
new file mode 100755
index 0000000..0e56507
--- /dev/null
+++ b/.xbindkeys/title
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+cat << EOF | xmacroplay $DISPLAY &>/dev/null
+KeyStr Escape
+String iecho -e '\033]2;${1+"$@"}\007'
+KeyStr Return
+EOF
diff --git a/.xbindkeysrc b/.xbindkeysrc
new file mode 100644
index 0000000..ffc93c2
--- /dev/null
+++ b/.xbindkeysrc
@@ -0,0 +1,4 @@
+# "Focus window under cursor"
+# Mod4 and Return => Send click at current pointer location.
+"xmacroplay $DISPLAY < ~/.xbindkeys/leftclick"
+  mod4 + Return
diff --git a/lensort b/lensort
new file mode 100755
index 0000000..cb1fd7a
--- /dev/null
+++ b/lensort
@@ -0,0 +1,13 @@
+#!/bin/bash
+#
+# $Id$
+#
+
+if [ "$1" = "-r" ]; then
+  shift
+  sort_opts="-r"
+fi
+
+awk 'BEGIN { FS=RS }; { print length, $0 }' ${1+"$@"} |
+sort -n $sort_opts |
+sed 's/^[0-9][0-9]* //'
diff --git a/sshcolourterm b/sshcolourterm
new file mode 100755
index 0000000..02ae9e1
--- /dev/null
+++ b/sshcolourterm
@@ -0,0 +1,26 @@
+#!/bin/bash
+#
+# $Id$
+#
+
+SSHCOLOURS=~/.ssh/colours
+
+fqdn=${1##*@}
+colour=
+
+# Get colour by regex.
+for path in $(ls "$SSHCOLOURS" | lensort -r); do
+  re=${path##*/}
+  echo "$fqdn" | grep -qs "$re" || continue
+  colour=$(readlink "$SSHCOLOURS/$path")
+  break
+done
+
+if [ ! -z "$colour" ]; then
+  colour=${colour##*/}
+  colour=${colour##*:}
+  echo -e "\033]49;$colour\007"
+  clear
+fi
+
+exec ${SSHTERM_SSH:-ssh} ${1+"$@"}
diff --git a/sshterm b/sshterm
new file mode 100755
index 0000000..3e9f734
--- /dev/null
+++ b/sshterm
@@ -0,0 +1,7 @@
+#!/bin/bash
+#
+# $Id$
+#
+
+${SSHTERM:-xterm} ${SSHTERM_TITLE:--title} "$1" ${SSHTERM_EXEC:--e} \
+sshcolourterm ${1+"$@"}
diff --git a/usize b/usize
new file mode 100755
index 0000000..6a806ab
--- /dev/null
+++ b/usize
@@ -0,0 +1,10 @@
+#!/bin/bash
+#
+# $Id$
+#
+
+if [ $# -lt 2 ]; then
+  echo "Usage: usize <width> <height>"
+  exit 1
+fi
+echo -e "[8;$2;$1;t"
-- 
2.7.4