Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config file, custom font and set base path #14

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

lewohy
Copy link

@lewohy lewohy commented Jun 19, 2021

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"
        }
    ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant