diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-14 15:54:53 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-14 15:54:53 +0000 |
commit | e7899cdb45eabbaf50227160213254dcbecb33db (patch) | |
tree | c0f377f16214710c032306a174406eb80769a43c |
R6.6 is the Xorg base-lineXORG-MAINXORG-STABLE
-rw-r--r-- | fontname.sh | 49 | ||||
-rw-r--r-- | fontprop.sh | 29 | ||||
-rw-r--r-- | xon | 162 | ||||
-rw-r--r-- | xon.man | 79 |
4 files changed, 319 insertions, 0 deletions
diff --git a/fontname.sh b/fontname.sh new file mode 100644 index 0000000..39bf8e2 --- /dev/null +++ b/fontname.sh @@ -0,0 +1,49 @@ +#!/bin/sh + +# +# This script is used to generate the FONT property given correct information +# in the various other fields. +# + +awk 'BEGIN { + fontname_registry = ""; + foundry = ""; + family_name = ""; + weight_name = ""; + slant = ""; + setwidth_name = ""; + add_style_name = ""; + pixel_size = ""; + point_size = ""; + resolution_x = ""; + resolution_y = ""; + spacing = ""; + average_width = ""; + charset_registry = ""; + charset_encoding = ""; +} + +/^FONTNAME_REGISTRY/ { fontname_registry = $2; } +/^FOUNDRY/ { foundry = $2; } +/^FAMILY_NAME/ { family_name = $2; } +/^WEIGHT_NAME/ { weight_name = $2; } +/^SLANT/ { slant = $2; } +/^SETWIDTH_NAME/ { setwidth_name = $2; } +/^ADD_STYLE_NAME/ { add_style_name = $2; } +/^PIXEL_SIZE/ { pixel_size = $2; } +/^POINT_SIZE/ { point_size = $2; } +/^RESOLUTION_X/ { resolution_x = $2; } +/^RESOLUTION_Y/ { resolution_y = $2; } +/^SPACING/ { spacing = $2; } +/^AVERAGE_WIDTH/ { average_width = $2; } +/^CHARSET_REGISTRY/ { charset_registry = $2; } +/^CHARSET_ENCODING/ { charset_encoding = $2; } +/^ENDPROPERTIES/ { exit; } + +END { + printf "%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s\n", \ + fontname_registry, foundry, family_name, weight_name, \ + slant, setwidth_name, add_style_name, \ + pixel_size, point_size, resolution_x, resolution_y, \ + spacing, average_width, charset_registry, charset_encoding; +}' $* | sed 's/"//g' diff --git a/fontprop.sh b/fontprop.sh new file mode 100644 index 0000000..71f8e5d --- /dev/null +++ b/fontprop.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# +# This script is used to generate the various XLFD font properties given an +# XLFD-style font name: +# +# -FOUNDRY-FAMILY_NAME-WEIGHT_NAME-SLANT-SETWIDTH_NAME-ADD_STYLE_NAME- ... +# ... PIXEL_SIZE-POINT_SIZE-RESOLUTION_X-RESOLUTION_Y-SPACING- ... +# ... AVERAGE_WIDTH-CHARSET_REGISTRY-CHARSET_ENCODING +# + +awk -F- ' +{ + printf "FONTNAME_REGISTRY \"%s\"\n", $1; + printf "FOUNDRY \"%s\"\n", $2; + printf "FAMILY_NAME \"%s\"\n", $3; + printf "WEIGHT_NAME \"%s\"\n", $4; + printf "SLANT \"%s\"\n", $5; + printf "SETWIDTH_NAME \"%s\"\n", $6; + printf "ADD_STYLE_NAME \"%s\"\n", $7; + printf "PIXEL_SIZE %d\n", $8; + printf "POINT_SIZE %d\n", $9; + printf "RESOLUTION_X %d\n", $10; + printf "RESOLUTION_Y %d\n", $11; + printf "SPACING \"%s\"\n", $12; + printf "AVERAGE_WIDTH %d\n", $13; + printf "CHARSET_REGISTRY \"%s\"\n", $14; + printf "CHARSET_ENCODING \"%s\"\n", $15; +}' $* @@ -0,0 +1,162 @@ +#!/bin/sh +# $Xorg: xon.sh,v 1.4 2000/12/20 16:50:07 pookie Exp $ +# start up xterm (or any other X command) on the specified host +# Usage: xon host [arguments] [command] + +usage() { + if [ -n "$1" ] + then + echo "`basename $0`: $1" + fi + echo "" + echo "Usage: `basename $0` hostname [options] [command ...]" + echo "" + echo "where options include:" + echo " -access add remote host to local host access list" + echo " -debug enable error messages from remote execution" + echo " -name name set alternate application name and window title" + echo " -nols do not pass -ls option to remote xterm" + echo " -screen screen change remote screen number to specified screen" + echo " -user user run remote command as the specified user" + exit 1 +} + +if [ $# -eq 0 ] +then + usage +fi + +target=$1 +shift +label=$target +resource=xterm-$label +if [ -f /usr/bin/remsh ]; then + rsh=/usr/bin/remsh +elif [ -f /usr/bin/rcmd ]; then + rsh=/usr/bin/rcmd +else + rsh=rsh +fi +rcmd="$rsh $target -n" +case $DISPLAY in +unix:*) + DISPLAY=`echo $DISPLAY | sed 's/unix//'` + ;; +esac +case $DISPLAY in +:*) + fullname=`uname -n` + hostname=`echo $fullname | sed 's/\..*$//'` + if [ $hostname = $target ] || [ $fullname = $target ]; then + DISPLAY=$DISPLAY + rcmd="sh -c" + else + DISPLAY=$fullname$DISPLAY + fi + ;; +esac +username= +sess_mangr= +xauth= +case x$XUSERFILESEARCHPATH in +x) + xpath='HOME=${HOME-`pwd`} ' + ;; +*) + xpath='HOME=${HOME-`pwd`} XUSERFILESEARCHPATH=${XUSERFILESEARCHPATH-"'"$XUSERFILESEARCHPATH"'"} ' + ;; +esac +redirect=" < /dev/null > /dev/null 2>&1 &" +command= +ls=-ls +continue=: +while $continue; do + case $1 in + -user) + shift + + if [ $# -eq 0 ] + then + usage "-user option requires an argument" + fi + + username="-l $1" + label="$target $1" + rcmd="$rsh $target $username -n" + shift + case x$XAUTHORITY in + x) + XAUTHORITY="$HOME/.Xauthority" + ;; + esac + case x$XUSERFILESEARCHPATH in + x) + ;; + *) + xpath="XUSERFILESEARCHPATH=$XUSERFILESEARCHPATH " + ;; + esac + ;; + -access) + shift + xhost +$target + ;; + -name) + shift + + if [ $# -eq 0 ] + then + usage "-name option requires an argument" + fi + + label="$1" + resource="$1" + shift + ;; + -nols) + shift + ls= + ;; + -debug) + shift + redirect= + ;; + -screen) + shift + + if [ $# -eq 0 ] + then + usage "-screen option requires an argument" + fi + + DISPLAY=`echo $DISPLAY | sed 's/:\\([0-9][0-9]*\\)\\.[0-9]/:\1/'`.$1 + shift + ;; + *) + continue=false + ;; + esac +done +case x$XAUTHORITY in +x) + ;; +x*) + xauth="XAUTHORITY=$XAUTHORITY " + ;; +esac +case x$SESSION_MANAGER in +x) + ;; +x*) + sess_mangr="SESSION_MANAGER=$SESSION_MANAGER " + ;; +esac +vars="$xpath$xauth$sess_mangr"DISPLAY="$DISPLAY" +case $# in +0) + $rcmd 'sh -c '"'$vars"' xterm '$ls' -name "'"$resource"'" -T "'"$label"'" -n "'"$label"'" '"$redirect'" + ;; +*) + $rcmd 'sh -c '"'$vars"' '"$*$redirect'" + ;; +esac @@ -0,0 +1,79 @@ +.\" $Xorg: xon.man,v 1.4 2001/02/09 02:05:35 xorgcvs Exp $ +.\" Copyright 1994, 1998 The Open Group +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and its +.\" documentation for any purpose is hereby granted without fee, provided that +.\" the above copyright notice appear in all copies and that both that +.\" copyright notice and this permission notice appear in supporting +.\" documentation. +.\" +.\" The above copyright notice and this permission notice shall be included in +.\" all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +.\" THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +.\" WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +.\" OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +.\" SOFTWARE. +.\" +.\" Except as contained in this notice, the name of The Open Group shall not +.\" be used in advertising or otherwise to promote the sale, use or other +.\" dealing in this Software without prior written authorization from the +.\" The Open Group. +.TH XON 1 "Release 6.4" "X Version 11" +.SH NAME +xon \- start an X program on a remote machine +.SH SYNOPSIS +.B xon +remote-host [-access] [-debug] [-name window-name] [-nols] [-screen screen-no] +[-user user-name] [command ...] +.SH DESCRIPTION +.I Xon +runs the specified command (default xterm -ls) on the remote machine using +rsh, remsh, or rcmd. Xon passes the DISPLAY, XAUTHORITY and +XUSERFILESEARCHPATH environment variables to the remote command. +.PP +When no command is specified, xon runs 'xterm -ls'. It additionally +specifies the application name to be 'xterm-\fIremote-host\fP' and the +window title to be '-fIremote-host\fP'. +.PP +Xon can only work when the remote host will allow you to log in without a +password, by having an entry in the .rhosts file permitting access. +.SH OPTIONS +.PP +Note that the options follow the remote host name (as they do with rlogin). +.sp +.IP "\fB-access\fP" +Runs xhost locally to add the remote host to the host access list in the X +server. This won't work unless xhost is given permission to modify the +access list. +.IP "\fB-debug\fP" +Normally, xon disconnects the remote process from stdin, stdout and stderr +to eliminate the daemon processes which usually connect them across the +network. Specifying the \fB-debug\fP option leaves them connected so that +error messages from the remote execution are sent back to the originating +host. +.IP "\fB-name window-name\fP" +This specifies a different application name and window title for the default +command (xterm). +.IP "\fB-nols\fP" +Normally xon passes the -ls option to the remote xterm; this option +suspends that behaviour. +.IP "\fB-screen screen-no\fP" +This changes the screen number of the DISPLAY variable passed to the remote +command. +.IP "\fB-user user-name\fP" +By default, xon simply uses rsh/remsh/rcmd to connect to the remote machine +using the +same user name as on the local machine. This option cause xon to specify an +alternative user name. This will not work unless you have authorization to +access the remote account, by placing an appropriate entry in the +remote users .rhosts file. +.SH BUGS +Xon can get easily confused when the remote-host, user-name or various +environment variable values contain white space. +.PP +Xon has no way to send the appropriate X authorization information to the +remote host. |