 All right, what's up? I got a really good example of something in computing that is very simple computationally to do That people just make very complicated way more complicated than that should be and I think it's a good example Of how you can make your life better by simplifying So bookmarking. Okay. I got this email maybe last week and I just uh, you know, it kind of filed it away I saved it So this guy says I was greatly inspired by your video on pass when it was released passes a password manager You can check it out. You can look up. I'm gonna forget to put the link to it, but look pass and Luke Smith It's the one with the Apu with the suit on in the thumbnail I have been using it as my sole password manager ever since very simple All it does is just saves passwords Encrypted on your hard drive and then recalls them when you need it And of course it can easily generate random passwords and all this kind of stuff I wonder if you use or can recommend something similar for bookmark managing I might be mistaken, but I think I saw you using or saying you use some script based on D menu for it Can't find videos or scripts in your dot files that we didn't so yes I've been doing this for bookmarking for years and I haven't done a video on it because it's so simple It seems almost stupid to do a video on it But since like this is a recurring question I get I guess I might as well This is one of those things that's right in front of your face that is is way easier than you think So I'm gonna show you what I do and things that you can make You know you can make this even more simple for you. I'm not even a big bookmarker So this guy actually links some Certainly, you know there he linked this page that I pulled up over here where like there are literally people who have like I don't all this software I don't know that runs that does bookmarking and you can pay for these services and stuff like that and That's just nuts to me. I mean, I'm sure a lot of these things do that do things that the simple thing I'm gonna show you can't But I I like making simple software and then you when you want to think about syncing devices and other things You you build that on top of it. Okay, let me show you what I'm thinking of I'll show you how my bookmarking thing works at any time on my computer I can hold down super and I can press insert and I will get a menu of all these bookmarks that I bookmarked and So I'm just gonna put in I don't know. Let's say well, I can it's a D menu So I can type whatever or I can select it, you know, however So landshad.net, right? Let's say I'm gonna go to that site This this is just a way of doing bookmarking down the thing first thing about this to note Is that it's not specific to my browser, right? I can pull up a terminal In fact, this is originally what I used I began using this system for I began using it when I was like Oh, let's say I'm you know making I was actually rewriting my website and I need to you know Have a bunch of links and stuff like that. So I want to have a link to my video site my video site Right all that kind of stuff. So it's not just for browsers. It can work for your chat application It can work in Vim. It can work in the terminal, whatever. It's independent. That's good thing number one So all this thing is all my system is is literally just a text file It's literally just a single text file and here's where it is on my machine local share Larb snippets, okay? I don't often open it like this, but that's where it is Okay, so this is just where I put all my bookmarks now, of course, I usually I rarely add stuff to this file So I usually just open it when I need to or I'll have a short cut So, you know, I have like a you know bookmark files thing where I can put if you use larbs You can do this where you can just say let's say local share larbs snippets and Bind that to SN. So then you just type SN and it will open that file, right? But anyway, so I just add this stuff to this file I don't really need to add that much notice that most of the stuff I have are URLs Okay, got a whole bunch of URLs But at the same time I also have things that aren't URLs So like this like but Bitcoin address or Monero address, right? Those are things that are hard to type like you don't want to mistype those But they're also not URLs, but the thing with the script is I can get it Let's say I type in big all my Bitcoin address bang got my Bitcoin address, right? So that's the nice thing about that. Okay, I can I can type any of this stuff pretty easily So How does this work? How does this work literally all it is is a text file, but the command that calls it is in my DWM configuration file, so it is For that so it's this line right here Okay, so if you don't have DWM if you don't know see doesn't matter But this is the command that I have bound right so it's mapped to super plus insert and It just it takes the content of this file pipes it into D menu That's the thing that gives me the menu then you select what you want then it cuts out the first element and Then all this output that it cuts out It will run xd type and that basically xd type xd2 will type excuse me That just types out the content that it has so that's why it's not just outputting to your terminal It you know it is you know, you're adding stuff you're typing things out here, right? so it at any time if I want to add stuff to the snippets file, you know, let's say I Don't think my book site is in here. Let me add that so HTTPS colon slash slash lindy press Dot net right so now that's bookmarked. I don't think I see that in the file So now I could go here and just input that content whenever I want and go there And so yeah nice and simple by the way I have new books I should do videos on the new books that I've done but go go and buy them if you want So that's how that works right now if you want to make this more complicated or not even more complicated But if you want to build stuff on top of this all we have remember all we have for this is a file this text file And we just have a command that's like Calling them from D menu and outputting them That's all we have to put them in there or to get them out But if you want you can also add a script and a bind to let's say add stuff to this file Okay, so let's say you want a bookmarking. So actually here's an idea One key that I don't have bound is Capital B. Yeah, so if you hold down super in capital B This is not bound to anything. So let's buy all B bookmark. Let's bind that to a bookmark So if I if I'm at a url, I would let's say I want to let's say I'm at this site and I highlight this url Let's say I want to be able to save that into my bookmarks file, right? Let's make a script for that. So I'm gonna go to my scripts directory. I'm gonna create a script. We'll say I don't know bookmark this Okay, and then I'm gonna make it executable and Let's create this thing. So bookmark this make it a shell script Okay And here's what we'll say so to do this let's say we want we want to highlight something and then be able to just run this command So how to let's say book Mark is going to equal the variable bookmark is going to be equal to X clip X clip oh Now what X clip oh is you can check out the manual for X clip if you want But that is that's a thing for like taking things from your things that you've copied or you have selected If you just do X clip oh without any other arguments that will take whatever you have selected, right? So that's this right now So it's going to set the variable bookmark equal to that And at the end of the script if everything works out we want to echo bookmark To our snippets file actually let's make another variable for snippets Very well, we'll say file right so the file we were using earlier, which is what home You can make it whatever you want so long as the directory exists local share larbs snippets Okay, I'm pretty sure that's it So at the end of the script we're going to want it to output to this file So let's just text test if this works, right? So where's our snippets file? Okay here it is right now So let's say I take this Oh, we've got to bind the key. Hold on. So let's just bind this This is going to run the script. What is it bookmark this? Is that what I called it? So I'm going to call it bookmark this right Technically you should make it look like this. I don't know. Maybe maybe I should just do it that way because that's like I want to set a better example We don't want to call an extra unneeded Um I just lost my train of thought we want to we don't want to call an extra sub-shell that we don't need So let's say bookmark this Um, so now Recompile our window manager refresh our window manager All of my windows are going to get screwed up for a second But now this script should be bound to uh, capital b. Okay, so let's try this out. Let's get this and we'll take this to the other Windows so now I'm going to highlight this and I'm going to run Super capital b or press super capital b and that should oh look at that It popped out at the end of this file, right? So now every time I type in Super capital b. I noticed that when this screen turned off the exposure on this camera changed I got pale. I wanted to I don't like the okay now it now it looks back and it looks more tan I don't know. I I hate how I hate auto exposing cameras. I really love it, but um, anyway, so now every time we type super capital b Whatever we have highlighted. Okay, that's going to be added to the end of our bookmarks file here And that also means when we type in, you know insert. Oh look, we can now select these things Oh my goodness. That's freaking awesome. So if you want to go further, I reckon this script is very it's not very robust, frankly Because obviously, you know, I could highlight this multiple times And press the bind multiple times. Oops. I just added this thing like three times We don't really want that to happen. Do we so what we can do Is we can say stuff like, you know, let's say if Uh, well, I don't know. Let's do this. So we'll grep out the sequence bookmark Um From the file. Okay. So what is this saying? You look at the queue option. So this command is like searching the file For the sequence for this sequence we're trying to bookmark if it's at the beginning of a line And if it's at the end of a line, right? And only if it is not Do we actually add it? Okay, let's say let's say that or maybe we should we should probably do if right We should probably say if You know grab all that kind of stuff Uh, then blah blah blah else Blah blah blah. So if um, it if we find The bookmark already there. I'm going to say notify notify send um oops already Bookmarked Okay, and if it succeeds we're going to say, uh bookmark Added so Bookmark is now saved to the file Okay, so, uh, let's go back here and we'll highlight this and we'll press that Oops already bookmarked. Okay, because that's already bookmarked. But let's go in here And let's remove let's remove all this All the instances where we bookmarked it before and now we highlight it and oh bookmark added right perfect So now we it's a little more complicated. But you know, it it does like basically what you want. I mean, okay This is what I'm talking about. I'm not I'm not here to create like this system for like bookmarking Right now. This is like the simplest shell script in the world But what I'm getting at is like instead of using complicated programs. Okay, whatever and again I'm not I'm not I'm not adding any of these people I literally know know nothing about the the things that they've made maybe they're great um, but all you need is a text file and With basically this teeny tiny script actually with even less you could just like echo the output of x clip, right? You could just do, you know, literally like x clip Oh to the file, right, you know, it's that simple. Um With just just that you can get a lot of what people actually want in bookmarking and with one other command That calls it into d menu, right? You're using things in a unixi way You're like you're using programs in the way they intend Um, so the only other thing I'm not going to talk about this in this video But let's say a lot of people like their bookmark synced. Okay. How do you how do you sync a bookmark? Well, uh, it's actually the same this guy brought up, right? He brought up pass a password manager and he says that he's been using it, right Passes the same way by default all it is is save stuff on your computer And it's usable with d menu and all this kind of stuff Well, then you think about hey, I could build a rsync script on top of this that syncs my computers Or I could use sync thing a sync thing, you know requires a graphical environment, right? I think it still requires a graphical Um, or at least they intend you to use it through a browser, which I really don't like But there are a million other tools that already exist that do syncing, right? Um that You know, you can use to like sync this from one device to another, right? So what I'm trying to get at is instead of using like this new I mean, this is what I talked about when I talked about like my emoji inserting Thing, right? So I have a another d menu script d menu. Oh my goodness. It's so awesome Um, I have a d menu script that inserts emojis And it's nice because I don't need a separate emoji module for my browser and chat window and terminal And all this kind of stuff and you don't need a separate bookmarking thing for all these things as well Because if you use simple text files Then you can you can build stuff on top of them And now if you want to think about this is again not something I'm going to do in this video But if you want to think about syncing them with other computers, then you can use pre existing tools That already do this stuff well to sync up everything Instead of using some new system that might you know sync stuff up in its own ways And you have five different things making connections sync everything up at once. That's mortal what I'm thinking about So that's it. That's all I got to say in this video. Uh, see you guys next time