#!/data/data/com.termux/files/usr/bin/bash

# debugging
#echo $1
#echo $2

# get a wake lock so we dont get background killed
/data/data/com.termux/files/usr/bin/termux-wake-lock

# sync nc -> local based on emacs profile and on/off arg
if [ "$1" == "org" ] && [ "$2" == "" ]; then
	/data/data/com.termux/files/home/.shortcuts/rclone-nc-local
fi
if [ "$1" == "code" ] && [ "$2" != "" ]; then
	/data/data/com.termux/files/home/.shortcuts/rclone-devdocs
fi

# run emacs ; assume this will run awhile -- mind battery drain
/data/data/com.termux/files/usr/bin/emacs --with-profile $1

# sync local -> nc based on emacs profile and on/off arg
if [ "$1" == "org" ] && [ "$2" == "" ]; then
    /data/data/com.termux/files/home/.shortcuts/rclone-local-nc
fi
# conditional here to save typing when it needs sestup
#if [ "$1" == "code" ] && [ "$2" != "" ]; then
#fi

# release wake lock
/data/data/com.termux/files/usr/bin/termux-wake-unlock