 Hello, and welcome. We've been looking at Android devices and just surviving the Android environment. A lot of times you're stuck on a device and you want to be able to have as much freedom on your mobile devices as you do your desktop device. And one of the things that give you that easily is the Turmux application, which right now, I'm recording this on my desktop. That's because I'm connected through the network to my phone. And we're going to be looking at what you can do. So we are in Turmux right here. I'm running ZShell on my Turmux with Tmux on there as well, not to get the too confused. Turmux is the Android application environment. And Tmux is something that I run on all my Linux distros that allows me to do things like split the screen like that. So now the top half of the screen is my Android phone. The bottom half is my desktop. I can split the screen again. Now I have two shells going from my desktop here all in one window. Anyway, going back, we are now on my Android device. And let's have a quick look at, I actually have the same config files. I have the same ZShell RC file and with my modifications in the ZShell RC.local file. So let me see. Yeah, right there. Now I have a few things in here. This down here just starts Tmux. And that's just the same thing I have on my desktop. It's looking on my phone. I'm probably never going to be in the dev TTY1, but it still checks for it and makes sure that screen, whether screen is running or not. But that allows every time I open up a new shell, it starts Tmux for me. Up here, your path is where your applications run. I'm not going to go into details on this stuff. I'm hoping that you probably already know this sort of thing if you're watching my videos. But I'm adding this path right here. I created it in my home directory for Tmux, a hidden folder, .bin. And there I can put in all my scripts so that I can have my own custom commands. And I just add it to my path directory here like that. That makes it easier. I can back up my home directory on my phone and move it to a new phone. The next one down here, this is actually I have to update this particular device. Because I don't do this like this anymore. But this is, and we'll talk more about this in this video, the Tmux clipboard set. We'll take whatever text you pass it and put it in your Android clipboard. On a desktop device, I usually use XClip, which requires Xorg. And it can send, put things in, and take things out of your clipboard. Right here, I'm aliasing XClip to the Tmux clipboard set so that I can pipe stuff. If I have this in a script, I can already send stuff to my clipboard. I actually have updated that where I don't have this as an alias anymore I have a script that's just maybe five or six lines long that checks whether you're passing stuff to it or not. So make it act more like XClip. That way I don't have to change my scripts. As you'll see in a moment, I have modified some of my scripts to use Tmux clipboard either set or get. Where if my newer setup, I have a script that's called XClip that acts a little bit like XClip. So I don't have to update all of my scripts individually for Android devices. Other things I have are for reset in case the text in the screen gets messed up. Tmux open again is part of the API package for Tmux which just opens up an Android application. If you pass it a PDF or an image or a video, it's going to open it up in the proper thing. On most Linux desktops, if you're running XDG-open is what does that. So I alias that and then I also just shorten it up for open because typing on your phone can be a pain. So I just made something a little bit shorter. But let's go ahead and move into my .bin folder here in my home directory on my Android device in my Tmux environment. List out the scripts I have here. I have a number of scripts here is the one I looked at in a past video to GIF and it needs to be cleaned up a little bit. But let's see. I can actually, I have Vim installed. I'm just not sure if it's going to display it properly through the network here, but let's go ahead and try it anyway. There we go. So again, Vim with all my Vim configurations running right here on my phone. But in here I'm setting storage. So I have the Tmux, I'm sorry, the Tmux storage API running so I can access things like my photos and whatnot. So I set that directory here. I check the date because I relabel the output GIF with the date stamp. Here I'm setting open to Tmux open, which again, since I aliased it to XDG dash open, I could just use XDG dash open like I would on a desktop, but this is probably before I aliased it or before I realized I aliased it because sometimes I forget I do stuff. But anyway, that's just going to allow me to use the open command here to open the image at the end. I'm setting the frame rate for my GIFs to 10. I set this arrival here so you can change it. So we're moving into the camera directory here. Checks whether you passed the R argument, which would set reverse to true. Here I'm setting, creating an array of all the MP4s. I'm giving you the list and allowing you to select the number from there. Then it checks if that file exists. If that file exists, then it starts the conversion process, whether it does it once or twice with the reverse. But that's just a quick look at the end there. It opens it up. Anyway, this video is really not about this script. I don't know why I went to such detail on that script. Let's look at another one, VIM Tiny URL here, which is the same script I use on my desktop, which I talked about in a previous video, but I changed the URL to check your clipboard on Android. Again, since I created this, I've created the alias or my script for XClip, so I wouldn't have to change the script at all. And the only reason I do that is because we're interacting with the clipboard on Android, which is different than interacting with your clipboard on an X or desktop environment, display environment, whatever you wanna call it. But yeah, so here, the only change I made to this, the only difference between this and my desktop application, which again, as I just said, I didn't need to change, is that we're getting a clipboard, what's in your clipboard. So here, I can go into my Android environment, highlight a URL, come in here, type TinyURL in my shell. It's gonna go to TinyURL. It's gonna get a TinyURL address for me. It's going to echo it to the screen. It's going to put it into my clipboard. It's also going to display it in my shell as a QR code. So I can then take another device and scan that QR code if I want. So it makes it very easy, yeah, I could go to the TinyURL website, I can paste in the address, I can click submit, I can get it, or I can just highlight it, type TinyURL in my shell, I can probably type TIN and hit tab in my shell it auto completes and not only does it submit it to the website, grabs it, displays the new URL on the screen along with the QR code. It also puts it into my clipboard for pasting other places. The only thing I also removed at the bottom here was the send notify, which on the desktop, it lets me know it displays little notification, which actually you can do with Turmux. If I just come into my shell here in Turmux and I type Turmux dash and I hit tab, you can see all these Turmux and this is after you install the API application. It has a lot of options here. One of them I'm pretty sure is, yeah, notification. And it sends an Android screen notification. Obviously the first time you write it, it's going to ask for permission to allow this application to display notifications. But there you go, you can run that. So I could have replaced my send notify command with this command. Other things you can do with Turmux just through here. Now some of these, I'm running Android version eight, I think currently on this device and somewhere along the line, some of these change the way they work and so they don't work anymore. There have been bug reports submitted to the Turmux GitHub or wherever they host their code. But most of these work, but like I said, you can get from the clipboard, you can set to the clipboard. I think taking a photo might not work currently. Turmux dialog, I'm not sure what that is. We could type it in to find out, but let's do it. Dialog dash H, I think. Joe's help. I'm not sure if this is a dialog, so let's just do it. Dialog, list widget options, set tile, let's go to T test. And I'll see if, oh, yep, I got a, I can't show you. I got a dialog screen on my Android device here with actually a input field that I can type into. So yeah, that's one place it makes a little dialog windows pop up, similar to Xennedy or, I don't think X dialog is still a thing, but Xennedy on a Linux desktop. It's probably similar to that, but we can actually probably look at the list of commands here, yeah. So you can do date pickers, counter checkboxes, spinners. That's awesome. I have not used this yet and that could be very useful. Let's go back and look at some other termux commands. I guess you can read from your fingerprint scanner, which is awesome. Fix shebang. So in your shell scripts, let's, let me, again, go ahead and look at one of my scripts in my bin folder. We'll take the tiny URL one. Actually, that's set right. I'm trying to think of what I did to change that. I might have changed the saying somewhere else. So normally when you create scripts in termux by default, if you try to do bin bash, it's not going to work in termux because that's not where the bash executable for termux is, but if you run the termux fix shebang line on your script, it'll change it to wherever the path for bash is. I don't remember what I did to make bash work properly. If I did something, or maybe there was an update to termux that fixed that, but we just used the tiny URL application and we didn't use it. Did we use it? Tiny URL. And we're probably going to get that there, a QR code. I don't know. Yeah, we didn't have a URL in there so that QR code's not really linking to anything. It's probably just blank. And also obviously I don't have curl installed, but let me just do apt install. You don't have to pseudo because you don't need to be root in this because you don't have root access in it. Install curl. Let's see if that works. And yeah, I have a few Android devices so this one might not be as up to date as the others. There we go. And now curl is installed. So now I should be able to, in my Android environment, let me go ahead and I know you can't see what I'm doing. I'm going to go and grab filmsbychrist.com. I'm gonna say copy. Now I should be able to run tiny URL here. And there we go. We got a tiny URL and everything works. So I just had to install curl on this device. I just hadn't done that since I put this script on there. But now it works and we should be able to. Let me double check. I will scan that with my phone. Yeah, it's tiny URL when I click on it, it opened up filmsbychrist.com version seven. Yeah, so I'm just going through some of these. Some of these I haven't played with yet. Apparently if you have an infrared device on your Android device, you can access it, I guess. Microphone recording notification we just talked about, which is different than dialogue. Open URL will open up a URL which I use quite often in my scripts. And yeah, like I said, you can check your, actually I think this is outdated when you run that. It says, hey, run this command, the termux sms list, which basically gives you the JSON output of your recent texts. I don't use the default SMS application. I use Hangouts on my phone, so that doesn't really work for me. I mean, it works, but it doesn't show my messages. Sending will send a text that works fine. Speech to text, although you can also probably install, I'm pretty sure I've installed, what's the, eSpeak, eSpeak? eSpeak, yeah, that's, I believe that's the repository. Again, get storage, you run that once. It will ask for permission on your Android device. And then if you look in my home directory here, I'll list out, you can see that I have a folder called storage, if I list out what's in storage, it's actually just links to different things, your music, your downloads, your external SD card, or whatever external storage you have on there. Just all your storage folders that you have on your Android device, and that way you can access things like your pictures and your downloads with your shell scripts. You only have to do that once and it's set up and good to go. Anyway, I just wanted to give you a little more look at Turmux and what it can do. I think Torch probably, I would assume that turns on your light. I don't know what Turmux Toast is. Let's run it with the, oops, yep. Dash H, Toast shows text in the Toast. I trans, that should pop up. The texts who show either supply or arguments. Okay, I'll have to play with that a little bit. Anyway, I feel like I've talked a lot. This video's getting kind of long. I just wanted to show you all the things that Turmux can do as far as interacting with your Android device, not just running stuff in the shell. Since you don't have Xorg like you do on most desktop environments, on Linux, you can't run your regular GUI applications through it, but you can easily interact with a lot of the basic stuff, pop-ups, dialogues, notifications, your web browser, just using whatever applications used to open up files, all that sort of stuff. From script, and again, you can now write scripts that text people or dial phone numbers, which can be useful. Thank you for watching, visit filmsbychrist.com. That's Chris the K, there's a link in the description. As always, I thank you for watching. I hope you enjoyed this video and I hope that you have a great day.