-
Notifications
You must be signed in to change notification settings - Fork 95
For Android users
-
FX File Explorer(recommended): a file explorer app that allows you to connect to Termux space.
-
Connect to storage
> Select "Termux" as storage provider > Select Termux $HOME directory. (no root needed) - NOTE: Android's storage space is usually
Termux/hOME/storage
.- ie, the
Download
folder you normally see in most "File Explorer App" equals toTermux home/storage/downloads
- ie, the
-
-
Install
Termux
in Android, using theF-droid
app. Follow instructions here. -
Open Termux and type
apt update && apt upgrade
. -
Type
pkg install openssh
to install SSH for ssh-keys. -
Type
pkg install git
to install Git. -
Configure Git username and email:
git config --global user.name "John Doe" git config --global user.email [email protected]
NOTE: This is the name and email which will go into commits, it can be anything, not necessary related to your GitHub account.
-
In the Termux terminal, type
termux-setup-storage
to allow Termux access to your internal storage and/or SD card -
In the Termux terminal, create a folder for your graph, for example
cd documents; mkdir MyGraph
and clone your repo there with the commandgit clone [email protected]:{your-username}/{your-reponame}.git ~/storage/shared/MyGraph
-
Open Logseq and add a graph on that folder. Check that all looks ok.
-
Type
git config --global --add safe.directory ~/storage/shared/MyGraph
to enable Git operations on that folder.NOTE: If you encounter issues like this, please make sure you are using the correct path.
NOTE: It might increase your battery usage drastically, I highly recommend the shortcut method below in order to save battery life.
Check this gist for more.
-
Install
Termux:Widgets
fromF-droid
. -
In Termux, type
cd ~/.shortcuts
and edit a file named, for example,pull-graph
containing:#!/usr/bin/bash eval $(ssh-agent) source ~/../usr/bin/source-ssh-agent # path might varied based on your system and brand cd {your repo location} # eg: cd ~/documents/MyGraph git pull
NOTE: If you use password-free private keys for Git you don't need the
ssh-agent
line. You can include it to avoid typing the private key passphrase each time. -
In the same
~/.shortcuts
folder create a second one named, for example,push-graph
containing:#!/usr/bin/bash eval $(ssh-agent) source ~/../usr/bin/source-ssh-agent # path might varied based on your system and brand cd {your repo location} git add -A git commit -m "sync from android" git push
-
Add a widget for
Termux Widget
app to the Android screen, which will show the scripts available in~/.shortcuts
(in our example, it will showpull-graph
andpush-graph
). Taping on them, they will be executed by Termux.
- Tap
pull-graph
to download the most recent version of your graph from GitHub. - Open Logseq and admire the latest version of your notes.
- Edit/add notes, work on them.
- Exit Logseq and tap
push-graph
to upload your changes to GitHub.