#!/usr/bin/env bash
HOST=$1
[ -z "$HOST" ] && HOST=10.1.3.29

# Apparently dmenu doesn't source this... 
. ~/.bashrc

# Convenient for remote start
[ -z "$DISPLAY" ] && export DISPLAY=:0

if [ "$HOSTNAME" == core ]; then
    exec emacsclient -c
else
    # This doesn't work if it's not already started
    exec ssh -n -X -o ServerAliveInterval=10 -o ServerAliveCountMax=8 $HOST emacsclient -c
fi





