#!/bin/sh

# Define pydm environment
# Source the python enviroment and dependencies
if [ -d /afs/slac/g/lcls ]; then
    source /afs/slac/g/lcls/package/pydm/setup_pydm_env.bash
else
    source /usr/local/lcls/tools/script/use_pydm.sh
fi

# Make the directory that is needed. if it exits no error
mkdir -p '/tmp/evr-'$(whoami)

# Needs to have 700 permission
chmod 700 '/tmp/evr-'$(whoami)

# Set enviroment variable
export XDG_RUNTIME_DIR='/tmp/evr-'$(whoami)

pydm evrGlobal.py 2> /dev/null
