 So a few weeks ago. I made a video talking about how there are no good options for managing movies or managing a movie library on Linux and I Think that that is still very much true But in the comment section of that video someone made a comment that is very profound something that I didn't think about at the time and that I definitely should have if I wasn't such a blitting moron and That comment was basically Matt. Why don't you make a script? and I stared at that comment for an inordinate amount of time and Then I thought huh Maybe I should make a script, you know, you know, why didn't I think of that you dummy? I should have thought about making a script because really all I was looking for was a way to easily launch my Movies or TV shows without having to go into a file manager like Ranger or Crusader in order to do so And not that there's anything wrong with launching your movies that way, but I wanted something a little bit easier So I said about making a script and now my initial inclination Of how to do this was to use a Rofi script now I have many Rofi scripts already some of them Were Adopted from distro tube and other places and I've you know made several of my own based on templates that I've previously made So I have a ton of Rofi scripts So I basically know the basic layouts of a Rofi script of how to actually pipe something into Rofi so that it lists out Stuff, you know, whatever's in a directory or you know a number of programs or another number of options Whatever, you know, I know how to do that and I spent a few hours over the course of a few days Trying to get that to work now There's something going on with my Rofi configuration file Where it's showing icons for really weird reasons in places where it shouldn't and I haven't been able to find that yet I'm assuming it has something to do with the show icons flag that I have set up for when Rofi is launched in regular usage but Needless to say I didn't figure out Rofi As much as I should have so I was on the hunt for a different solution And then I saw a video from Jake at Linux talking about a program called fcf and basically what fcf is Or what it stands for even is fuzzy finding and if you're not familiar with fuzzy finding basically it's a searching mechanism for Searching through various directories files, whatever and it's a fantastic program that I'd heard of before But I never actually used outside of them So when I watched that video is like that's a very great script I'm gonna steal the idea behind it and Try to make it into my movie scripts to see if I can make this launch my movies now as It was it wasn't going to work simply because of the way my movie library was Organized I'm a big proponent of directories to me directories are kind of like tabs or specifically tab groups I can organize things into directories. I'm gonna do it. I have a ton of directories now It doesn't mean that I'm that way everywhere my my TV show Folder directory, whatever is a bleeding mess. It's not very well organized at all But my movies were fully organized I'd spent a long time going through and making sure every single movie had its own directory so that it could store the Movie itself any of the movie posters that I happen to have downloaded things like that Unfortunately with the way I wanted to use my Movie launching script that structure just wasn't going to work all that well So I took all of the movie files or themselves and move them all into one directory So that it was easier to do this script. It just seemed like the best way of doing it now there are ways of Writing a script so that it prunes out the things that you don't want to show You know, I could you know, I could use grep or whatever in order to show the things that I wanted to show But it just was easier to put everything into one directory even though it kind of messes with my OCD So all that is beside the point the script that I ended up with is a variation on the script from Jake at Linux and all I've really done is prune it down a little bit and Make it my own in certain small ways So I'm gonna show you what this script does and then I'll show you the script itself And I'll show you how you could adopt it if you wanted to use it for something similar to me So let's go ahead and jump in so before I show you the script Let me show you what it looks like and what it does so I have it set up as a scratch pad and the reason why I do that is because it's just Easier to have it pop up with a key binding in a scratch pad on q-tile or i3 or whatever I'm using so I do super shift B and it pops up and this is what fcf looks like Basically out of the box. I've done no styling whatsoever And it just looks like a list of movies now You can judge me for my movie tastes if you want to I don't care I happen to really like poor movies bad movies. So I have like a lot of bad movies here I'm sure everyone will agree, but I like the movies But anyways, we won't need to talk about that So the idea here is that if I wanted to say watch the italian job I could just search for the italian job and enter and it would launch into mpv And it would just start playing the italian job, you know, if I scrub through this or whatever you can see This is the this is you know the italian job. That's the basic idea behind the script I search for the movie I want to play hit enter and it starts playing now if you are in a desktop environment or a Window manager that doesn't have scratch pads the best way to do this is probably just from the terminal So if you have the the script in your path, you could do movie sh, which is the name of the script It would run the same thing and then I could type, you know italian job again It would just play it again just like so and you know that is just Basic way the script works and it is perfect for my use because that's really what I wanted to have When I made that video a few weeks ago I wanted a way to easily access my movie library without having to get into a file manager without having to go through And open up the directory find the the movie You know then play the movie inside of you know crusader or whatever You know, it was many many steps and it was just more of a pain than it should have been This is just a key binding and a search away and it's so good So what does the script look like it looks like this it is literally three lines The first line defines a variable that is the path to my movies The second line is basically defining another variable In this case what it's doing is it's using the ls command of the path that we set above And then it's going to use fzf or it's going to pipe that the result of that command into fzf And then we're going to take that menu variable which is set here And basically what that's doing is is it's using npv and then it just gives it the path to the movie So in this case it's going to take the overall path of the movie's directory and then the menu Variable which is just the name of the movie in in this case The name of the movie is also going to be name of the file of the movie So there it just basically creates the full path To the movie this extra stuff here is just making it so that when I play Something inside the terminal Let's just say I do that again like so and then I select die hard right if I just do that I could close I could close that particular terminal and not have npv go away That's what the nohub is doing there in that and then piping into dev know It just basically makes sure that the process of mpv doesn't get killed if the terminal itself gets killed And that's the entire script. It's so so good So easy and you could use this for basically anything that you wanted to do if you wanted to say If you have a directory of pdfs or something like that like for you know, our spreadsheets You could give it the path to your spreadsheet directory And then instead of having mpv here You could just have say libre office draw or libre office or whatever libre office writer Whatever happens to be just the name of the application and then the path to the file Which is which is given by the two variables up there and it would work exactly the same way obviously I'm using it for movies But it could be anything now it does work At least in this situation it works better When you have Your movies or whatever inside of one Directory so If I go to media here and then movies you can see I have all of my movies just in one directory I don't have them in several different directories now fzf will Work with multiple directories But if you're doing this so that you can have easy access to just these files It's easier if you don't have to drill down into many directories If they're just all in one, it's just a matter of searching for the thing that you need And that's the way that I found just to be easier. So yeah, that is my movie script And obviously I've taken quite a bit of inspiration from jake and several other people So kudos and credit to all those people and specifically jake for giving me the inspiration for this I've watched more movies since I've done this then I haven't a long time simply because it's easier for me to access Than having to go to a file manager. So yeah, that is my movie script if you have thoughts on this You can leave those in the comment section below Um, I I would really appreciate it. I know that this is probably a very nerdy video So won't appeal to very many people, but whatever it doesn't matter Uh, thanks everybody for watching you can follow me on masters honor odyssey those links will be in the video description You can support me on page on a page on dot com slash linux cast Again head on over to jake at linux channel and give him a subscribe He's a fantastic youtuber. So there's a lot of really cool stuff. Uh, you can follow me on uh, master honor. Honestly, I already did those Totally through through my end cap off Anyways, uh, thanks everybody who does support me on patreon youtube because you're all absolutely amazing without you The channels would not be anywhere near where it is right now So thank you very very much for your support patreon.com slash linux cast if you want to support me over there Also, uh, the youtube membership thing works down there. It's the bottom if you want to support me here on youtube Thanks again to everybody who does support me you guys are amazing I already said that you know this ending totally didn't work out the way it usually does I don't know what's going on there. Just totally completely lost mine. Anyways, thanks everybody for watching. I'll see you next time Definitely did not