Skip to content

Instantly share code, notes, and snippets.

@jcsackett
Created November 18, 2010 02:14
Show Gist options
  • Save jcsackett/704532 to your computer and use it in GitHub Desktop.
Save jcsackett/704532 to your computer and use it in GitHub Desktop.
x-only trick from One Thing Well (http://onethingwell.org/post/1432068153/x-only)
#!/bin/bash
# Did a program get specified?
if test $# -lt 1; then
echo "You must specify a program to run with x.";
exit;
fi
# Did a tty get specified?
if test $# -lt 2; then
tty=1;
else
tty=$2;
fi
# If a tty was specified, is it legit?
if test $tty -gt 6; then
echo "Cannot use a tty higher than 6.";
exit;
fi
# And finally, xinit.
xinit $1 -- :$tty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment