To something like internal storage rather than somewhere in the system partition which typically has much less space available.
I was going to comment some bad words because i thought you meant the bin folder with the executables, but i realised you didnt mean that
I think this would be a nice idea and probably not that hard to implement
Thanks!
I think you can't execute anything in storage on Android 5 or higher, so if home is there, lots of inconvenience.
as a workaround, ln -s /storage/emulated/0/Download
That's a good point. People usually have scripts in the home folder aswell.
I was not talking about executing anything. The scenario that I was thinking was this.
Imagine you want to download a custom rom to your internal storage. With most system partitions being so small, you will not have enough space to do that using something like wget into the system partition since it is so SMALL. But if you could save to internal storage as default, you would not be limited in the size of file that you wanted to download. Especially if you want to download using something like wget or Axel. Add to this the fact that currently one would need to have root access and use the SU command to access the internal storage and that termux packages can not be used as root under current circumstances.
On top of all this, if someone downloads a file and wanted to just move it to internal storage, they can not do this WITHOUT root.
I really feel that this is in the best interest of the user as it can improve security by not needing to use root, and add more functionality to non-root users. Lastly if someone wants to view the downloaded file, from a file manager they still need root. After all, isn't the point of termux to be able to do MORE in Android without needing to root a device?
just ln -s /storage/emulated/0/Download as mentioned before.
If it's possible for termux to access storage, this should work, and convenient enough, why fixating on moving home there?
You can move files from termux internal storage without root...
If you want a home folder than cd /sdcard/Documents and bam
I don't really understand the problem. Most if not all Linux distributions create a standard home directory in the same way Termux does. 'Home' is user specific, thus if you create a variable named USERNAME and assign it a value, e.g. 'user2', that user's home directory will be sought under '~/home/user2' - which needs to be created with mkdir -p.
You may be thinking of termux-download which uses the Android system's downloader and stores dl'd files in '/cache' rather than the pwd from which that command is called.
In contrast, wget works from anywhere and unless directed otherwise on the cmd line, in an alias or a function, wget downloads into the pwd.
Example:
@localhost:\~/storage/downloads$ alias wget
alias wget="'wget --no-clobber --report-speed=bits -a '/data/data/com.termux/files/home/tmp/wget-log'"
@localhost:\~/storage/downloads$ wget "http://audio.ra.co/podcast/RA553_170102_Mark-Barrott-residentadvisor.net.mp3"
@localhost:~/storage/downloads$ ll *.mp3
-rw-rw---- 1 root everybody 159M Jan 3 01:16 RA553_170102_Mark-Barrott-residentadvisor.net.mp3
>
I think we don't need any additional setting in the app for this.
If one wants to have a the home directory on shared storage, one can simply move the /data/data/com.termux/files/home folder to shared storage, and setup /data/data/com.termux/files/home as a symlink to that folder.
@fornwall So apparently I did some searching and termux-setup-storage allows you to do this without root. Though I never knew this. Any way we can have the app ask for permissions on first boot?
@soaringowl2145 Great!
I want to avoid asking it automatically, since many people use Termux as e.g. a simple ssh client, and for them the question would just be suspicious spam.
However, I'll probably add a prompt with some short information so that more people can find it easier.
@fornwall Thank you!
termux-setup-storage creates a ~/storage folder, but I'm interested in this feature request primarily so I can share the configs in $HOME with a Linux Deploy install (in particular ~/.ssh, ~/.vimrc etc.).
Having automatic softlinks which are set up in each new instance would be one solution (traditionally I'd use bind mounts, but that would require root).
Most helpful comment
@soaringowl2145 Great!
I want to avoid asking it automatically, since many people use Termux as e.g. a simple ssh client, and for them the question would just be suspicious spam.
However, I'll probably add a prompt with some short information so that more people can find it easier.