# Taamas' Mainpage
A locally hosted webpage to use as a browser home page.
## Description
This is a simple, minimalist mainpage. It consists of a title, a background and some buttons for search fields in selected webpages. When a button is clicked, the corresponding search box appears and the others are hidden.
## Configuration
For the mainpage to work, the home page of the browser must be set to the path of `index.html`, for example `file:///home/username/.mainpage/index.html`.
The background image to be loaded must be named `bg.jpg` and be located in a folder named `img` which has to be in the same folder as `index.html`. This can be customized editing the `background-image: url(../img/bg.jpg);` line in `css/style.css`.
To change the title, edit the `
Taamas' mainpage
` line in `index.html`.
The search fields loaded are determined by a file in the root of the page directory named `urls`. The syntax of given urls is as follows:
```
'[mnemonic]': '[url]' #[name]
```
+ `mnemonic` is the text on the button.
+ `url` is the search url and has to contain `{}`, which will be subtituted by search terms.
+ `name` can be used as a reminder of the target web name and will appear as the search box background.
In my case, this file is generated by a command executed by vim when I save the configuration file of qutebrowser, where my preferred search engines are stored:
```bash
autocmd BufWritePost ~/.config/qutebrowser/config.py !cat .config/qutebrowser/config.py | grep -e \'.*\':\ \'.*{}.*\' | grep -v DEFAULT | sed 's/,//' | sed 's/^\ *//' > ~/.mainpage/urls
```
The repo includes a file named `urlsExample`. This file can be edited to configure the prefered search fields. Remember to rename it to `urls` afterwards or create a new `urls` file. The `urlsExample` serves just as a guide for syntax and is not used by the page in any way, so it can be removed safely.