overhaul emacs approach and inline rclone sync into run scripts ; this should be least/worst for my daily workflow(s)

This commit is contained in:
KemoNine 2022-08-11 12:58:25 -04:00
parent a15c1ef7b2
commit 4c46f6a8fa
8 changed files with 47 additions and 18 deletions

View file

@ -55,18 +55,13 @@ if grep -q "Android" <<< `uname -a`; then
if ! [ -d ~/.shortcuts ]; then if ! [ -d ~/.shortcuts ]; then
mkdir ~/.shortcuts mkdir ~/.shortcuts
fi fi
# tasker scripts (in case boot ones fail, they can be poked via tasker automations)
if ! [ -d ~/.termux/tasker ]; then
mkdir ~/.termux/tasker
fi
# cannot use symlinks -- termux forces full path execution from android launcher shortcuts # cannot use symlinks -- termux forces full path execution from android launcher shortcuts
cp $PATH_PREFIX/shortcuts/* ~/.shortcuts/ cp $PATH_PREFIX/shortcuts/* ~/.shortcuts/
cp $PATH_PREFIX/emacsd/* ~/.termux/tasker
# reload settings # reload settings
termux-reload-settings termux-reload-settings
fi fi
echo "use tasker scripts to launch emacsd styled setup on boot ; Termux::Boot does not work for me"
echo "exa fd bat tmux htop nano most ripgrep emacs zsh lf restic rclone glow" echo "exa fd bat tmux htop nano most ripgrep emacs zsh lf restic rclone glow"
echo "copy restic.sh if desired/needed" echo "copy restic.sh if desired/needed"
echo "setup rclone for org/nextcloud sync if necessary (use 'nc-personal' for destination name)"
echo "run tmux and do <prefix>-I to install plugins and finish setup" echo "run tmux and do <prefix>-I to install plugins and finish setup"

View file

@ -1,3 +0,0 @@
#!/data/data/com.termux/files/usr/bin/sh
/data/data/com.termux/files/usr/bin/termux-wake-lock
/data/data/com.termux/files/usr/bin/tmux new-session -s emacsd-code '/data/data/com.termux/files/usr/bin/emacs --with-profile code'

View file

@ -1,3 +0,0 @@
#!/data/data/com.termux/files/usr/bin/sh
/data/data/com.termux/files/usr/bin/termux-wake-lock
/data/data/com.termux/files/usr/bin/tmux new-session -d -s emacsd-org '/data/data/com.termux/files/usr/bin/emacs --with-profile org'

View file

@ -1,2 +1,2 @@
#!/bin/bash #!/bin/sh
emacs --with-profile code /data/data/com.termux/files/home/.shortcuts/emacs code

View file

@ -1,2 +0,0 @@
#!/bin/sh
emacs ~/storage/shared/org/games_destiny.org

42
shortcuts/emacs Executable file
View file

@ -0,0 +1,42 @@
#!/data/data/com.termux/files/usr/bin/sh
# debugging
#echo $1
#export RC_DEBUG="-P --dry-run"
# org storage locations
export LOCAL_ORG="/data/data/com.termux/files/home/storage/shared/org/"
export NC_ORG="nc-personal:/org/"
# rclone common flags/switches
export RC_COMMON="--delete-after --fast-list --human-readable --interactive"
export RC_EXCLUDE="--exclude=archivebox --exclude=/Attic/** --exclude=/Documents/**"
# get a wake lock so we dont get background killed
/data/data/com.termux/files/usr/bin/termux-wake-lock
# sync org data to local device (pull down outstanding changes, if any)
echo "starting rclone from nextcloud -> local storage"
/data/data/com.termux/files/usr/bin/rclone sync \
$RC_COMMON $RC_EXCLUDE $RC_DEBUG \
$NC_ORG $LOCAL_ORG
# pause to review rclone output
echo "press enter to continue"
read junkvar
# run emacs ; assume this will run awhile -- mind battery drain
/data/data/com.termux/files/usr/bin/emacs --with-profile $1
# sync any local changes up to the main server
echo "starting rclone from local storage -> nextcloud"
/data/data/com.termux/files/usr/bin/rclone sync \
$RC_COMMON $RC_EXCLUDE $RC_DEBUG \
$LOCAL_ORG $NC_ORG
# pause to review rclone output
echo "press enter to continue"
read junkvar
# release wake lock
/data/data/com.termux/files/usr/bin/termux-wake-unlock

View file

@ -1,2 +1,2 @@
#!/bin/bash #!/bin/bash
emacs --with-profile org /data/data/com.termux/files/home/.shortcuts/emacs org

2
zshrc
View file

@ -86,7 +86,7 @@ if grep -q "Android" <<< `uname -a`; then
alias proot-distro-keeb-root="proot-distro login keeb" alias proot-distro-keeb-root="proot-distro login keeb"
alias proot-distro-keeb="proot-distro login --user keeb --termux-home keeb -- /bin/bash" alias proot-distro-keeb="proot-distro login --user keeb --termux-home keeb -- /bin/bash"
alias emacs="echo 'daemon mode -- use em [profile] instead'" alias emacs="echo 'daemon mode -- use em [profile] instead'"
alias em="/data/data/com.termux/files/usr/bin/emacsclient -t -a '' -s " alias em="/data/data/com.termux/files/home/.shortcuts/emacs "
fi fi
# dont allow mosh prediction (override in zshrc.local) # dont allow mosh prediction (override in zshrc.local)