# TO BE NAMED A quicker way to search up Magic the Gathering (TM) cards (no images). ## The Components This repo has 2 main parts to it: * The `magic_finder` rust code, which does the "heavy lifting" of updating a database, searching through it for cards, and finding close names (kind of) * The supporting scripts which use `[rofi](https://github.com/davatorium/rofi)` `magic_finder` can be used without the rofi parts if you wanted a command for loading showing basic mtg card info. The `rofi` part is so that I can quickly and easily, with a couple of commands, get the card info I want. Basically just adds a very simple and easy GUI to the `magic_finder` part. ## Requirements ### Magic Finder `magic_finder` is written in rust. Check the Cargo.toml file for more specific requirements. I was compiling with rustc version 1.88, but I would not at all be surprised if it worked on rust from year(s) ago. ### Rofi The rofi scripts require a version over (I think) 1.7.6. The scripts require the ability to set the `command` setting on the `filebrowser` option in rofi. From what I can tell, this was introduced in 1.7.6. Very annoyingly, the Ubuntu repos do *not* have this version. They have an earlier version. So, to use this, you'll need to get a more recent version yourself. I compiled and installed myself. See the end of this README for how I did that. ## Usage *TODO* ## Installation I am sorry in advance, this is a bit of a pain becuase of my lack of knowledge on how to properly "package" scripts alongside a rust binary. *TODO* ## How I Installed `rofi` If you're smarter than me, just follow the official docs: https://github.com/davatorium/rofi/blob/next/INSTALL.md and don't bother reading this. I am entirely unfamiliar with `meson` and `ninja` (I'm more a `Makefile` kinda guy - haven't done any `C` properly in >10 years), so here's what I did. This is for Ubutntu - you will need to do something different for download the dependencies (you can see them in the INSTALL.md file referenced above). Of note below, I'm installing this into my `$HOME/bin` directory. Change that part if you want to install somewhere else. Make sure to install it somewhere in your `$PATH` though! Clone the repo and move into it ``` git clone --recursive https://github.com/davatorium/rofi cd rofi ``` Install the deps ``` sudo apt build-dep rofi sudo apt install meson sudo apt install libxcb-keysyms1-dev libxcb-keysyms1 # I suspect only one of these is needed - not sure which ``` Setup and build (not sure why I put the prefix in here... you'll see below I still copy+pasted the bin) ``` meson setup build --prefix $HOME/bin -Dwayland=disabled -Dxcb=enabled ninja -C build -v ``` Fingers crossed that all compiled and stuff... then copy the bin ``` cp build/rofi ~/bin ```