Termux:Boot integration

Assistant: Integrate with Termux:Boot, so when it's installed, the
assistant is autostarted on boot.

This commit was sponsored by Boyd Stephen Smith Jr. on Patreon.
This commit is contained in:
Joey Hess 2018-04-25 15:31:25 -04:00
parent 9807e5bead
commit de491ad20f
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 41 additions and 23 deletions

View file

@ -23,6 +23,8 @@ import Utility.OSX
#else
import Utility.FreeDesktop
import Assistant.Install.Menu
import Utility.UserInfo
import Utility.Android
#endif
standaloneAppBase :: IO (Maybe FilePath)
@ -54,13 +56,24 @@ ensureInstalled = ifM (isJust <$> getEnv "GIT_ANNEX_PACKAGE_INSTALL")
#ifdef darwin_HOST_OS
autostartfile <- userAutoStart osxAutoStartLabel
#else
menufile <- desktopMenuFilePath "git-annex" <$> userDataDir
icondir <- iconDir <$> userDataDir
installMenu program menufile base icondir
autostartfile <- autoStartPath "git-annex" <$> userConfigDir
#endif
installAutoStart program autostartfile
#else
ifM osAndroid
( do
-- Integration with the Termux:Boot app.
home <- myHomeDir
let bootfile = home </> ".termux" </> "boot"
unlessM (doesFileExist bootfile) $ do
createDirectoryIfMissing True (takeDirectory bootfile)
writeFile bootfile "git-annex assistant --autostart"
, do
menufile <- desktopMenuFilePath "git-annex" <$> userDataDir
icondir <- iconDir <$> userDataDir
installMenu program menufile base icondir
autostartfile <- autoStartPath "git-annex" <$> userConfigDir
installAutoStart program autostartfile
)
#endif
sshdir <- sshDir
let runshell var = "exec " ++ base </> "runshell " ++ var

View file

@ -16,6 +16,10 @@ git-annex (6.20180410) UNRELEASED; urgency=medium
system may not get along with the bundled linker.
* runshell: Added some tweaks to make git-annex work in termux on
Android. The regular arm standalone tarball now works in termux.
* Webapp: Support being run inside termux on Android, and offer to set up
a repository on the sdcard.
* Assistant: Integrate with Termux:Boot, so when it's installed, the
assistant is autostarted on boot.
-- Joey Hess <id@joeyh.name> Mon, 09 Apr 2018 14:03:28 -0400

View file

@ -5,6 +5,7 @@ git-annex is not currently part of the Termux distribution, but it's easy
to install it. Paste these commands into Termux:
pkg install git wget tar
termux-setup-storage
cd
wget https://downloads.kitenet.net/git-annex/autobuild/armel/git-annex-standalone-armel.tar.gz
tar zxf git-annex-standalone-armel.tar.gz
@ -12,26 +13,32 @@ to install it. Paste these commands into Termux:
git-annex.linux/runshell
Now you can set up a git-annex repository or two, to manage your
Android files. Here we'll make one for camera photos.
Android files. To avoid typing any more, you can start up the
git-annex webapp and set things up in there:
git annex webapp
Or you can continue using git-annex at the command line. Here we'll make a
repository for photos:
termux-setup-storage
cd ~/storage/dcim
git init
git annex init
You can run the git-annex assistant in your repository, to automatically
notice new and changed files and commit them to the repository:
cd ~/storage/dcim
git annex assistant
You can set up a ssh remote pointing to a server, and the assistant will
automatically sync things up.
You can go on to set up a ssh remote pointing to a server, and sync
your files to and from it.
And so on. Most ways you would use git-annex on a Linux system work fairly
well in this Termux environment.
Known limitations:
## Starting on boot
If you install the Termux:Boot app, git-annex will also integrate with it.
Repositories you create with the webapp (or list in
~/.config/git-annex/autostart) will have the assistant started in them on
boot, so you don't need to start it manually.
## Known limitations
* Direct mode
@ -39,9 +46,3 @@ Known limitations:
limitations of Android's /sdcard. You can get around this using v6
unlocked repositories, or by putting the git-annex repository on a better
filesystem on the Android device, such as your termux home directory.
* Webapp
The webapp doesn't know how to open a web browser on Android. It displays
a `file://` url, and if you copy and paste that into a web browser, it
will work.