Script to set urxvt font.
authorIain Patterson <me@iain.cx>
Thu, 16 Oct 2008 16:00:02 +0000 (16:00 +0000)
committerIain Patterson <me@iain.cx>
Thu, 16 Oct 2008 16:00:02 +0000 (16:00 +0000)
git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@150 6be0d1a5-5cfe-0310-89b6-964be062b18b

ufont [new file with mode: 0755]

diff --git a/ufont b/ufont
new file mode 100755 (executable)
index 0000000..e0c8940
--- /dev/null
+++ b/ufont
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# $Id$
+#
+# ufont: Change urxvt font.
+# Usage: ufont <size> [<font>]
+# Example: ufont 12
+# Example: ufont 11 "xft:DejaVu Sans Mono"
+#
+
+aspect=0.9
+size="$1"; shift
+font="${1:-xft:DejaVu Sans Mono}"
+if [ -z "$size" ]; then
+  echo >&2 "Usage: ufont <size> [<font>]"
+  exit 1
+fi
+
+escape="$font:pixelsize=$size:aspect=$aspect"
+echo -e "\033]710;$escape\007\033]711;$escap\007"
+exit $?