Skip to content

Instantly share code, notes, and snippets.

@wisnij
Last active September 27, 2015 20:38
Show Gist options
  • Save wisnij/1328285 to your computer and use it in GitHub Desktop.
Save wisnij/1328285 to your computer and use it in GitHub Desktop.
Cygwin startxterm script
#!/bin/sh
#
# Start an xterm (and X if necessary) with a shortcut with this setting:
# C:\cygwin\bin\run.exe /usr/bin/bash.exe -l -c /path/to/startxterm
lockfile='/tmp/.X0-lock'
running=0
if [[ -e $lockfile ]]; then
pid=`cat $lockfile`
if [[ -e /proc/$pid ]]; then
running=$pid
else
rm -f $lockfile
fi
fi
if [[ $running -eq 0 ]]; then
/usr/bin/startx -- :0 -multiwindow -clipboard -silent-dup-error -screen 0 3840 1920 -emulate3buttons
else
/usr/bin/run /usr/bin/xterm -display :0.0 -e bash -l
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment