Compare commits

...

3 commits

Author SHA1 Message Date
2425723226 docs: update help.svg 2023-01-07 10:21:21 -06:00
85f017faed chore: make pre-commit happy 2023-01-07 10:16:51 -06:00
916e85c67c chore: switch to pre-commit 2023-01-07 10:16:51 -06:00
7 changed files with 98 additions and 60 deletions

24
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,24 @@
exclude: "^(src/.*|bin/font-patcher)"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pycqa/isort
rev: 5.9.3
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.2
hooks:
- id: shellcheck

View file

@ -29,16 +29,20 @@ update-src:
$(call msg,Updating Source Files)
@./bin/update-src
## lint | check shell scripts
## lint | run pre-commit hooks
.PHONY: lint
lint:
@shfmt -w -s $(shell shfmt -f bin/)
@pre-commit run --all
## clean | remove patched fonts
.PHONY: clean
clean:
@rm -rf patched/*
# depends on daylinmorgan/yartsu
assets/help.svg:
yartsu -o $@ -t 'make help' -- $(MAKE) -s help
msg = $(call tprint,{a.bold}==>{a.end} {a.b_magenta}$(1){a.end} {a.bold}<=={a.end})
USAGE = {a.b_green}Update MonoLisa with Nerd Fonts! {a.end}\n\n{a.header}usage{a.end}:\n make <recipe>\n
-include .task.mk

View file

@ -80,6 +80,16 @@ You can verify the fonts have been added with `make check`.
If I haven't committed to this repo in a while it's likely a good idea to run `make update-src` to update the fonts, icons and patcher script from nerd fonts.
## Contributing
Before making changes to to any of the scripts in `bin` you should first install `pre-commit`.
Followed by setting up the `pre-commit` hooks locally.
```bash
pipx install pre-commit
pre-commit install
```
## Special Thanks
- [MonoLisa](https://www.monolisa.dev)

View file

@ -1,4 +1,4 @@
<svg class="rich-terminal shadow" viewBox="0 0 585.3333333333334 399.5333333333333" xmlns="http://www.w3.org/2000/svg">
<svg class="rich-terminal shadow" viewBox="0 0 610.3333333333334 399.5333333333333" xmlns="http://www.w3.org/2000/svg">
<!-- Generated with Rich https://www.textualize.io -->
<style>
@font-face {
@ -16,14 +16,14 @@
font-weight: 700;
}
.terminal-747138606-matrix {
.terminal-2663349072-matrix {
font-family: Fira Code, monospace;
font-size: 20px;
line-height: 24.4px;
font-variant-east-asian: full-width;
}
.terminal-747138606-title {
.terminal-2663349072-title {
font-size: 18px;
font-weight: bold;
font-family: arial;
@ -33,78 +33,78 @@
-webkit-filter: drop-shadow( 2px 5px 2px rgba(0, 0, 0, .7));
filter: drop-shadow( 2px 5px 2px rgba(0, 0, 0, .7));
}
.terminal-747138606-r1 { fill: #a6e3a1;font-weight: bold }
.terminal-747138606-r2 { fill: #c6d0f5 }
.terminal-747138606-r3 { fill: #94e2d5;font-weight: bold }
.terminal-747138606-r4 { fill: #f9e2af;font-weight: bold }
.terminal-747138606-r5 { fill: #8288a5 }
.terminal-2663349072-r1 { fill: #a6e3a1;font-weight: bold }
.terminal-2663349072-r2 { fill: #c6d0f5 }
.terminal-2663349072-r3 { fill: #94e2d5;font-weight: bold }
.terminal-2663349072-r4 { fill: #f9e2af;font-weight: bold }
.terminal-2663349072-r5 { fill: #8288a5 }
</style>
<defs>
<clipPath id="terminal-747138606-clip-terminal">
<rect x="0" y="0" width="548.0" height="316.2" />
<clipPath id="terminal-2663349072-clip-terminal">
<rect x="0" y="0" width="572.4" height="316.2" />
</clipPath>
<clipPath id="terminal-747138606-line-0">
<rect x="0" y="1.5" width="549" height="24.65"/>
<clipPath id="terminal-2663349072-line-0">
<rect x="0" y="1.5" width="573.4" height="24.65"/>
</clipPath>
<clipPath id="terminal-747138606-line-1">
<rect x="0" y="25.9" width="549" height="24.65"/>
<clipPath id="terminal-2663349072-line-1">
<rect x="0" y="25.9" width="573.4" height="24.65"/>
</clipPath>
<clipPath id="terminal-747138606-line-2">
<rect x="0" y="50.3" width="549" height="24.65"/>
<clipPath id="terminal-2663349072-line-2">
<rect x="0" y="50.3" width="573.4" height="24.65"/>
</clipPath>
<clipPath id="terminal-747138606-line-3">
<rect x="0" y="74.7" width="549" height="24.65"/>
<clipPath id="terminal-2663349072-line-3">
<rect x="0" y="74.7" width="573.4" height="24.65"/>
</clipPath>
<clipPath id="terminal-747138606-line-4">
<rect x="0" y="99.1" width="549" height="24.65"/>
<clipPath id="terminal-2663349072-line-4">
<rect x="0" y="99.1" width="573.4" height="24.65"/>
</clipPath>
<clipPath id="terminal-747138606-line-5">
<rect x="0" y="123.5" width="549" height="24.65"/>
<clipPath id="terminal-2663349072-line-5">
<rect x="0" y="123.5" width="573.4" height="24.65"/>
</clipPath>
<clipPath id="terminal-747138606-line-6">
<rect x="0" y="147.9" width="549" height="24.65"/>
<clipPath id="terminal-2663349072-line-6">
<rect x="0" y="147.9" width="573.4" height="24.65"/>
</clipPath>
<clipPath id="terminal-747138606-line-7">
<rect x="0" y="172.3" width="549" height="24.65"/>
<clipPath id="terminal-2663349072-line-7">
<rect x="0" y="172.3" width="573.4" height="24.65"/>
</clipPath>
<clipPath id="terminal-747138606-line-8">
<rect x="0" y="196.7" width="549" height="24.65"/>
<clipPath id="terminal-2663349072-line-8">
<rect x="0" y="196.7" width="573.4" height="24.65"/>
</clipPath>
<clipPath id="terminal-747138606-line-9">
<rect x="0" y="221.1" width="549" height="24.65"/>
<clipPath id="terminal-2663349072-line-9">
<rect x="0" y="221.1" width="573.4" height="24.65"/>
</clipPath>
<clipPath id="terminal-747138606-line-10">
<rect x="0" y="245.5" width="549" height="24.65"/>
<clipPath id="terminal-2663349072-line-10">
<rect x="0" y="245.5" width="573.4" height="24.65"/>
</clipPath>
<clipPath id="terminal-747138606-line-11">
<rect x="0" y="269.9" width="549" height="24.65"/>
<clipPath id="terminal-2663349072-line-11">
<rect x="0" y="269.9" width="573.4" height="24.65"/>
</clipPath>
</defs>
<rect fill="#1e1e2e" stroke="rgba(255,255,255,0.35)" stroke-width="1" x="10.1667" y="1" width="565" height="365.2" rx="8"/><text class="terminal-747138606-title" fill="#c6d0f5" text-anchor="middle" x="282" y="27">help</text>
<rect fill="#1e1e2e" stroke="rgba(255,255,255,0.35)" stroke-width="1" x="10.1667" y="1" width="590" height="365.2" rx="8"/><text class="terminal-2663349072-title" fill="#c6d0f5" text-anchor="middle" x="295" y="27">make&#160;help</text>
<g transform="translate(32,22)">
<circle cx="0" cy="0" r="7" fill="#ff5f57"/>
<circle cx="22" cy="0" r="7" fill="#febc2e"/>
<circle cx="44" cy="0" r="7" fill="#28c840"/>
</g>
<g transform="translate(18.166666666666664, 41) scale(.95)" clip-path="url(#terminal-747138606-clip-terminal)">
<g transform="translate(18.166666666666664, 41) scale(.95)" clip-path="url(#terminal-2663349072-clip-terminal)">
<g class="terminal-747138606-matrix">
<text class="terminal-747138606-r1" x="0" y="20" textLength="402.6" clip-path="url(#terminal-747138606-line-0)">Update&#160;MonoLisa&#160;with&#160;Nerd&#160;Fonts!&#160;</text><text class="terminal-747138606-r2" x="549" y="20" textLength="12.2" clip-path="url(#terminal-747138606-line-0)">
</text><text class="terminal-747138606-r2" x="549" y="44.4" textLength="12.2" clip-path="url(#terminal-747138606-line-1)">
</text><text class="terminal-747138606-r3" x="0" y="68.8" textLength="61" clip-path="url(#terminal-747138606-line-2)">usage</text><text class="terminal-747138606-r2" x="61" y="68.8" textLength="12.2" clip-path="url(#terminal-747138606-line-2)">:</text><text class="terminal-747138606-r2" x="549" y="68.8" textLength="12.2" clip-path="url(#terminal-747138606-line-2)">
</text><text class="terminal-747138606-r2" x="97.6" y="93.2" textLength="158.6" clip-path="url(#terminal-747138606-line-3)">make&#160;&lt;recipe&gt;</text><text class="terminal-747138606-r2" x="549" y="93.2" textLength="12.2" clip-path="url(#terminal-747138606-line-3)">
</text><text class="terminal-747138606-r2" x="549" y="117.6" textLength="12.2" clip-path="url(#terminal-747138606-line-4)">
</text><text class="terminal-747138606-r4" x="0" y="142" textLength="146.4" clip-path="url(#terminal-747138606-line-5)">&#160;&#160;&#160;&#160;&#160;&#160;&#160;patch</text><text class="terminal-747138606-r2" x="146.4" y="142" textLength="36.6" clip-path="url(#terminal-747138606-line-5)">&#160;|&#160;</text><text class="terminal-747138606-r5" x="183" y="142" textLength="317.2" clip-path="url(#terminal-747138606-line-5)">add&#160;nerd&#160;fonts&#160;to&#160;MonoLisa</text><text class="terminal-747138606-r2" x="549" y="142" textLength="12.2" clip-path="url(#terminal-747138606-line-5)">
</text><text class="terminal-747138606-r4" x="0" y="166.4" textLength="146.4" clip-path="url(#terminal-747138606-line-6)">update-fonts</text><text class="terminal-747138606-r2" x="146.4" y="166.4" textLength="36.6" clip-path="url(#terminal-747138606-line-6)">&#160;|&#160;</text><text class="terminal-747138606-r5" x="183" y="166.4" textLength="366" clip-path="url(#terminal-747138606-line-6)">move&#160;fonts&#160;and&#160;update&#160;fc-cache</text><text class="terminal-747138606-r2" x="549" y="166.4" textLength="12.2" clip-path="url(#terminal-747138606-line-6)">
</text><text class="terminal-747138606-r4" x="0" y="190.8" textLength="146.4" clip-path="url(#terminal-747138606-line-7)">&#160;&#160;&#160;&#160;&#160;&#160;&#160;check</text><text class="terminal-747138606-r2" x="146.4" y="190.8" textLength="36.6" clip-path="url(#terminal-747138606-line-7)">&#160;|&#160;</text><text class="terminal-747138606-r5" x="183" y="190.8" textLength="317.2" clip-path="url(#terminal-747138606-line-7)">check&#160;fc-list&#160;for&#160;MonoLisa</text><text class="terminal-747138606-r2" x="549" y="190.8" textLength="12.2" clip-path="url(#terminal-747138606-line-7)">
</text><text class="terminal-747138606-r4" x="0" y="215.2" textLength="146.4" clip-path="url(#terminal-747138606-line-8)">&#160;&#160;update-src</text><text class="terminal-747138606-r2" x="146.4" y="215.2" textLength="36.6" clip-path="url(#terminal-747138606-line-8)">&#160;|&#160;</text><text class="terminal-747138606-r5" x="183" y="215.2" textLength="292.8" clip-path="url(#terminal-747138606-line-8)">update&#160;nerd&#160;fonts&#160;source</text><text class="terminal-747138606-r2" x="549" y="215.2" textLength="12.2" clip-path="url(#terminal-747138606-line-8)">
</text><text class="terminal-747138606-r4" x="0" y="239.6" textLength="146.4" clip-path="url(#terminal-747138606-line-9)">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;lint</text><text class="terminal-747138606-r2" x="146.4" y="239.6" textLength="36.6" clip-path="url(#terminal-747138606-line-9)">&#160;|&#160;</text><text class="terminal-747138606-r5" x="183" y="239.6" textLength="231.8" clip-path="url(#terminal-747138606-line-9)">check&#160;shell&#160;scripts</text><text class="terminal-747138606-r2" x="549" y="239.6" textLength="12.2" clip-path="url(#terminal-747138606-line-9)">
</text><text class="terminal-747138606-r4" x="0" y="264" textLength="146.4" clip-path="url(#terminal-747138606-line-10)">&#160;&#160;&#160;&#160;&#160;&#160;&#160;clean</text><text class="terminal-747138606-r2" x="146.4" y="264" textLength="36.6" clip-path="url(#terminal-747138606-line-10)">&#160;|&#160;</text><text class="terminal-747138606-r5" x="183" y="264" textLength="244" clip-path="url(#terminal-747138606-line-10)">remove&#160;patched&#160;fonts</text><text class="terminal-747138606-r2" x="549" y="264" textLength="12.2" clip-path="url(#terminal-747138606-line-10)">
</text><text class="terminal-747138606-r4" x="0" y="288.4" textLength="146.4" clip-path="url(#terminal-747138606-line-11)">&#160;&#160;&#160;&#160;&#160;h,&#160;help</text><text class="terminal-747138606-r2" x="146.4" y="288.4" textLength="36.6" clip-path="url(#terminal-747138606-line-11)">&#160;|&#160;</text><text class="terminal-747138606-r5" x="183" y="288.4" textLength="170.8" clip-path="url(#terminal-747138606-line-11)">show&#160;this&#160;help</text><text class="terminal-747138606-r2" x="549" y="288.4" textLength="12.2" clip-path="url(#terminal-747138606-line-11)">
</text><text class="terminal-747138606-r2" x="549" y="312.8" textLength="12.2" clip-path="url(#terminal-747138606-line-12)">
<g class="terminal-2663349072-matrix">
<text class="terminal-2663349072-r1" x="0" y="20" textLength="402.6" clip-path="url(#terminal-2663349072-line-0)">Update&#160;MonoLisa&#160;with&#160;Nerd&#160;Fonts!&#160;</text><text class="terminal-2663349072-r2" x="573.4" y="20" textLength="12.2" clip-path="url(#terminal-2663349072-line-0)">
</text><text class="terminal-2663349072-r2" x="573.4" y="44.4" textLength="12.2" clip-path="url(#terminal-2663349072-line-1)">
</text><text class="terminal-2663349072-r3" x="0" y="68.8" textLength="61" clip-path="url(#terminal-2663349072-line-2)">usage</text><text class="terminal-2663349072-r2" x="61" y="68.8" textLength="12.2" clip-path="url(#terminal-2663349072-line-2)">:</text><text class="terminal-2663349072-r2" x="573.4" y="68.8" textLength="12.2" clip-path="url(#terminal-2663349072-line-2)">
</text><text class="terminal-2663349072-r2" x="97.6" y="93.2" textLength="158.6" clip-path="url(#terminal-2663349072-line-3)">make&#160;&lt;recipe&gt;</text><text class="terminal-2663349072-r2" x="573.4" y="93.2" textLength="12.2" clip-path="url(#terminal-2663349072-line-3)">
</text><text class="terminal-2663349072-r2" x="573.4" y="117.6" textLength="12.2" clip-path="url(#terminal-2663349072-line-4)">
</text><text class="terminal-2663349072-r4" x="0" y="142" textLength="170.8" clip-path="url(#terminal-2663349072-line-5)">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;patch</text><text class="terminal-2663349072-r2" x="170.8" y="142" textLength="36.6" clip-path="url(#terminal-2663349072-line-5)">&#160;&#160;</text><text class="terminal-2663349072-r5" x="207.4" y="142" textLength="268.4" clip-path="url(#terminal-2663349072-line-5)">apply&#160;nerd&#160;fonts&#160;patch</text><text class="terminal-2663349072-r2" x="573.4" y="142" textLength="12.2" clip-path="url(#terminal-2663349072-line-5)">
</text><text class="terminal-2663349072-r4" x="0" y="166.4" textLength="170.8" clip-path="url(#terminal-2663349072-line-6)">&#160;&#160;update-fonts</text><text class="terminal-2663349072-r2" x="170.8" y="166.4" textLength="36.6" clip-path="url(#terminal-2663349072-line-6)">&#160;&#160;</text><text class="terminal-2663349072-r5" x="207.4" y="166.4" textLength="366" clip-path="url(#terminal-2663349072-line-6)">move&#160;fonts&#160;and&#160;update&#160;fc-cache</text><text class="terminal-2663349072-r2" x="573.4" y="166.4" textLength="12.2" clip-path="url(#terminal-2663349072-line-6)">
</text><text class="terminal-2663349072-r4" x="0" y="190.8" textLength="170.8" clip-path="url(#terminal-2663349072-line-7)">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;check</text><text class="terminal-2663349072-r2" x="170.8" y="190.8" textLength="36.6" clip-path="url(#terminal-2663349072-line-7)">&#160;&#160;</text><text class="terminal-2663349072-r5" x="207.4" y="190.8" textLength="317.2" clip-path="url(#terminal-2663349072-line-7)">check&#160;fc-list&#160;for&#160;MonoLisa</text><text class="terminal-2663349072-r2" x="573.4" y="190.8" textLength="12.2" clip-path="url(#terminal-2663349072-line-7)">
</text><text class="terminal-2663349072-r4" x="0" y="215.2" textLength="170.8" clip-path="url(#terminal-2663349072-line-8)">&#160;&#160;&#160;&#160;update-src</text><text class="terminal-2663349072-r2" x="170.8" y="215.2" textLength="36.6" clip-path="url(#terminal-2663349072-line-8)">&#160;&#160;</text><text class="terminal-2663349072-r5" x="207.4" y="215.2" textLength="292.8" clip-path="url(#terminal-2663349072-line-8)">update&#160;nerd&#160;fonts&#160;source</text><text class="terminal-2663349072-r2" x="573.4" y="215.2" textLength="12.2" clip-path="url(#terminal-2663349072-line-8)">
</text><text class="terminal-2663349072-r4" x="0" y="239.6" textLength="170.8" clip-path="url(#terminal-2663349072-line-9)">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;lint</text><text class="terminal-2663349072-r2" x="170.8" y="239.6" textLength="36.6" clip-path="url(#terminal-2663349072-line-9)">&#160;&#160;</text><text class="terminal-2663349072-r5" x="207.4" y="239.6" textLength="244" clip-path="url(#terminal-2663349072-line-9)">run&#160;pre-commit&#160;hooks</text><text class="terminal-2663349072-r2" x="573.4" y="239.6" textLength="12.2" clip-path="url(#terminal-2663349072-line-9)">
</text><text class="terminal-2663349072-r4" x="0" y="264" textLength="170.8" clip-path="url(#terminal-2663349072-line-10)">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;clean</text><text class="terminal-2663349072-r2" x="170.8" y="264" textLength="36.6" clip-path="url(#terminal-2663349072-line-10)">&#160;&#160;</text><text class="terminal-2663349072-r5" x="207.4" y="264" textLength="244" clip-path="url(#terminal-2663349072-line-10)">remove&#160;patched&#160;fonts</text><text class="terminal-2663349072-r2" x="573.4" y="264" textLength="12.2" clip-path="url(#terminal-2663349072-line-10)">
</text><text class="terminal-2663349072-r4" x="0" y="288.4" textLength="170.8" clip-path="url(#terminal-2663349072-line-11)">&#160;&#160;&#160;&#160;&#160;&#160;&#160;h,&#160;help</text><text class="terminal-2663349072-r2" x="170.8" y="288.4" textLength="36.6" clip-path="url(#terminal-2663349072-line-11)">&#160;&#160;</text><text class="terminal-2663349072-r5" x="207.4" y="288.4" textLength="170.8" clip-path="url(#terminal-2663349072-line-11)">show&#160;this&#160;help</text><text class="terminal-2663349072-r2" x="573.4" y="288.4" textLength="12.2" clip-path="url(#terminal-2663349072-line-11)">
</text><text class="terminal-2663349072-r2" x="573.4" y="312.8" textLength="12.2" clip-path="url(#terminal-2663349072-line-12)">
</text>
</g>
</g>

Before

Width:  |  Height:  |  Size: 9 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

View file

@ -220,7 +220,7 @@ def main():
if fp_args:
echo(f"Flags passed to font-patcher: {fp_args}")
if args.verbose:
echo(f"Patching the following files")
echo("Patching the following files")
for fontfile in args.font_path:
sys.stdout.write(f" {color.magenta}->{color.end} {fontfile}\n")
if args.docker:

View file

@ -7,7 +7,7 @@ INSTALL_DIR=~/.local/share/fonts/MonoLisa
mkdir -p $INSTALL_DIR
for font_dir in $PATCHED_FONTS/*; do
for font_dir in "$PATCHED_FONTS"/*; do
patched_dir="${font_dir##*/}"
echo ">>> $patched_dir"
@ -15,10 +15,10 @@ for font_dir in $PATCHED_FONTS/*; do
if [[ -d ${dest} ]]; then
echo "deleting existing version"
rm -rf $dest
rm -rf "$dest"
fi
mkdir $dest && cp -v $font_dir/* $dest
mkdir "$dest" && cp -v "$font_dir"/* "$dest"
done
echo "Don't forget to run 'fc-cache -f -v'"

View file

@ -5,7 +5,7 @@ REPO_URL=git@github.com:ryanoasis/nerd-fonts.git
rm -rf nerd-fonts
git clone --filter=blob:none --no-checkout --depth 1 --sparse $REPO_URL
cd nerd-fonts
cd nerd-fonts || exit
git sparse-checkout add src/glyphs
git checkout