gritty
gritty copied to clipboard
config file, custom font and set base path
I've modified it to specify the config file. Then, I modified it to use external font and base path. It looks useful when using powerline font in terminals such as zsh.
If you do not use the config file, you can use it the same way as before.
Using external fonts works that you write the config file and set the font-family
value, ./bin/gritty.js
will copy the font file to the ./fonts
folder. Then ./bin/gritty.js
will create the external-font.css
file in the ./css
folder and link it to index.html.
And when the client is connected, the server sends a set-font message to the client. The client then sets it to that font and additionally fits it to fit the window.
When base path is set, http://127.0.0.1/base-path
is accessible.
The format of config.json is shown below.
{
"auto-restart": true,
"port": 8082,
"command": "zsh",
"base-path": "/base-path",
"font-family": "Hack",
"external-fonts": [
{
"name": "Hack",
"format": "truetype",
"path": "/some/path/Hack/Hack-Regular.ttf"
}
]
}