From bb61751c1299f3a7316d196b6db8dbfe9c822bff Mon Sep 17 00:00:00 2001 From: KemoNine Date: Sat, 24 Sep 2022 12:50:35 -0400 Subject: [PATCH] setup emacs script to allow for conditional sync based on a 2nd parm ; move to bash for easier logic code --- shortcuts/emacs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/shortcuts/emacs b/shortcuts/emacs index 22e6652..f68274b 100755 --- a/shortcuts/emacs +++ b/shortcuts/emacs @@ -1,19 +1,30 @@ -#!/data/data/com.termux/files/usr/bin/sh +#!/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 -# nextcloud auto-sync -/data/data/com.termux/files/home/.shortcuts/rclone-nc-local +# 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 -# nextcloud auto-sync -/data/data/com.termux/files/home/.shortcuts/rclone-local-nc +# 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