 Now, one little tool that you've probably always been looking for, but maybe you haven't found it, is Enter. It is a fantastic little utility for system management, system administration. It does something that you often want all the time, but it does it in one of the best ways that you possibly can. And that is, a lot of times when you're doing something on your computer, you want to have a command run every time you update a file. Maybe it's a log file, maybe it's some kind of output, maybe you're programming, maybe you're just writing a document and you want it to auto compile or something else like that. Maybe you want something to notify you when a file changes. Enter does all of this stuff. It has a very simple interface, but it is absolutely fantastic to use. I'm surprised this is not some core part of the Unix operating system. Well, there are equivalents, but Enter makes it very, very easy to get exactly what you want done. In fact, I'll just run you through the syntax because it's pretty simple. Let me think of a hypothetical example. Let's say I want to run a command. I want to get a little notification up here. I want to notify send command whenever I update my bash rc, just a random example. How you do that in Enter is very, very simple. What you do is you just echo bash rc into Enter and then you just give it whatever command you want it to run. Let's say notify send, and we'll give it the message of bash rc updated, very simple. If you run that, you're going to see actually, by default, you're going to get a notification at the very beginning because it will run the command at start. If you don't want that to happen, I should go ahead and say, if you don't want that to happen, you can just give it the P option, but either, oops, not notify send the P option, Enter the P option, excuse me. You can just give Enter the P option. But either way, what this script is going to do is whenever, let's say I'm in my bash rc and I make some kind of modification and I save this file, bam, this command is going to run. Now, I have a little notification, bash rc has been updated. Or you don't have to be editing it in an editor. You can do something like, let's echo a comment. This is a comment and let's echo that into bash rc. So we're modifying it through our commands and, oh, look at that, it's still, even though we didn't physically open the file, it still ran the Enter command. So Enter is very, very useful for this kind of stuff. And you probably are already thinking a lot of implementations for it, excuse me. You can actually look here, they give you some examples just for you to mull over. Now, oh, yeah, so you might be wondering, okay, this is weird syntax because what we have is why do you echo bash rc into Enter? Now that might strike you as sort of a weird thing to do. But this is really nice because, I mean, you don't have to use echo. You can use any kind of command and Enter can read standard input. So they give some examples here just to go over them. For example, let's say you're doing some web development and you want, you have some kind of command that gives you a preview of what your website is looking like. But you want to run that every time a file is changed. Well, you can just ls all your CSS and HTML files and pipe those into Enter. And then your update command is going to run every time any one of those files is changed. So that's very convenient. So you can take ls as some input. You can, as I did a second ago, use echo. You can use du with the a option to update all the files in an area or something. Here they give another example, right? So mu PDF, very nice PDF viewer. One thing it doesn't do by default is automatically update if a PDF file is changed. But you can very easily just ls all your PDF files and then put them in the Enter and update in mu PDF with them. Very, very simple. Now, I want to give you two examples of what I use, of what I use this for. One is going to be compiling documents and one is going to be using, so if you guys use NewsBoat, NewsBoat has this really annoying way of downloading podcasts. But I found a little fix for it using Enter. I guess a little hack, not a fix. So I'll do the compiling documents thing first because I think that's the one that has more, I don't know, more people would be able to use it. So here I have a little graph document, yet another example graph document. But I'm going to pull up, I actually just wrote this, you know, five minutes before I started the video because, you know, I'm not big into auto compilation, but I know some people are. But I made a little tiny auto compiler and it's super simple. It's a little script, I'll actually get rid of my face for a second. It's a little script that I called, what did I call it? Oh yeah, just auto comp, silly me. Now what this is, make this thing a little bigger. So I have in my VIM, here of course is a VIM buffer. In my VIM RC I have mapped this little command that will run auto comp every time I type leader A. And what auto comp does is first off it checks to see if there's an instance already existing and if it is, kills it because I want it to toggle. Ignoring that, the enter command that it runs is pretty simple. It just takes the file that you gave it and it just echoes it in to enter and it runs this compiler script. Now the compiler script you guys might know from my github, but well let me pull it up. So I just have this little compiler script that is really just, you know, has a bunch of case statements where, oh if it's a graph document run these commands, if it's a markdown document run these, you know, use pandoc or whatever. If it's a log tech file, it's just the general handler for different kinds of file types. So long story short, whenever I am in my VIM buffer, any VIM buffer now, I can just type leader and then A and that's going to activate a kind of auto compilation mode. So I'm going to bring up my PDF preview here. So just to illustrate that this is working, again, enter is running whenever I save my file here. So if I throw in some extra text, I save it, it auto compiles. Perfect. If I want to add in another paragraph, so let's put in another paragraph. It's always hard to spell paragraph, so I'm just going to wing it. Okay, so that again automatically appears and we can do pretty much do whatever we want, delete some text and every time we save it, that is going to update. Now of course you can go even further than this. Now again, I'm not an auto compilation person, but let's say you're the kind of person who likes VIM updating every time you leave normal mode or something or go into normal mode or change the buffer. Instead of looking at the main file like I have, you could look at VIMs, the buffer file or the swap files that VIM creates or something like that. Again pretty easy to do with enter. So let me give you my other use case. This is for auto compilation and all the files should be on my GitHub or they might be all update them. So that's auto compilation. Another use I have is there's this program I really like called NewsBoat. It is an RSS feed reader. It's fantastic for most things, but there's one thing about it I really don't like and that is by default to download a podcast. It's a big pain. If you go to one of these entries, let's go to one of my podcast entries here. If you go to one of these entries, the annoying thing about it is that to download a podcast you're supposed to press E to enqueue it and then you're supposed to open up this other program called PodBoat and then download it manually there. I think that's just a huge waste. So one nice thing, by the way I know someone's going to note, but yeah, that's right. I'm subscribed to Coast to Coast AM because I have to get my Boomer conspiracy theory radio. You just got to have it. I mean look at this stuff. Thomas talks about angels, demons, and ghosts. I got to have it. I don't even listen to it that much, but I just like just having all the episodes because why not? It's an American cultural icon. Say what you want. But anyway, the nice thing about, even though I don't like this functionality in NewsBoat, the nice thing is whenever I enqueue one of these files, it actually puts it in a file that I can access with Enter and that's what I've done. I have a little script here, PodEnter, and this runs every time I start my graphical environment and it takes that queue file that I just mentioned and it echoes it into Enter and it runs the queue and notify command every time that file is updated or whatever. So what is the queue and notify command? Well we can go see that. It is a little script. Actually, I'll show you how it works. Just go in here, enqueue it and you'll see I get this little message saying enqueuing this podcast. I'm going to enqueue this one, enqueue that one, enqueue that one. Now they're all enqueued and what this is actually doing, if you check the little script here, it is really just, it uses Task Spooler. I don't know if you know about Task Spooler, but it's just a little thing that you send it commands and it will automatically run them as opposed to manually run them in PodBoat. So it queues a download command and it also queues these little notifications. So I can be aware of whenever something finishes downloading. So that is much more convenient than opening PodBoat and manually downloading things. Such a pain. This is much easier and I can also change the file names because I think by default some podcasts will have like Windows file names so you can change that kind of stuff. So it's much more convenient and just using Enter I have this little script to process it, get a whole lot, not have to worry about it. So anyway that's about it. I hope this has given you some ideas for the kind of stuff you can do in Enter but chances are, I mean this is such a great program, such a general use program that you probably thought of your own use cases. So anyway hope you learned something and I will see you guys next time.