diff --git a/docker/Dockerfile b/docker/Dockerfile index 48e3da6..2845c21 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -4,11 +4,11 @@ ENV DEBIAN_FRONTEND=noninteractive # Locales ENV LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" LANGUAGE="en_US.UTF-8" RUN apt-get update && apt-get install -y \ - bat \ curl \ fd-find \ fontconfig \ git \ + gpg \ locales \ make \ python3 \ @@ -23,6 +23,12 @@ RUN apt-get update && apt-get install -y \ && locale-gen en_US.UTF-8 \ && rm -rf /var/lib/apt/lists/* +RUN mkdir -p /etc/apt/keyrings \ + && curl -fsSL https://repo.charm.sh/apt/gpg.key | gpg --dearmor -o /etc/apt/keyrings/charm.gpg \ + && echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" > /etc/apt/sources.list.d/charm.list \ + && apt-get update && apt-get install -y glow \ + && rm -rf /var/lib/apt/lists/* + RUN sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --yes COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ @@ -37,8 +43,7 @@ RUN wget -P /home/jan/.local/share/fonts https://github.com/ryanoasis/nerd-fonts && fc-cache -fv RUN mkdir -p ~/.local/bin \ - && ln -s $(which fdfind) ~/.local/bin/fd \ - && ln -s $(which batcat) ~/.local/bin/bat + && ln -s $(which fdfind) ~/.local/bin/fd RUN touch /home/jan/.zshrc diff --git a/files/glow/style.json b/files/glow/style.json new file mode 100644 index 0000000..6c047a3 --- /dev/null +++ b/files/glow/style.json @@ -0,0 +1,33 @@ +{ + "document": {"block_prefix": "\n", "block_suffix": "\n", "color": "252", "margin": 2}, + "block_quote": {"indent": 1, "indent_token": "│ "}, + "paragraph": {}, + "list": {"level_indent": 2}, + "heading": {"block_suffix": "\n", "color": "39", "bold": true}, + "h1": {"prefix": " ", "suffix": " ", "color": "228", "background_color": "63", "bold": true}, + "h2": {"prefix": "## "}, + "h3": {"prefix": "### "}, + "h4": {"prefix": "#### "}, + "h5": {"prefix": "##### "}, + "h6": {"prefix": "###### ", "color": "35", "bold": false}, + "text": {}, + "strikethrough": {"crossed_out": true}, + "emph": {"italic": true}, + "strong": {"bold": true}, + "hr": {"color": "240", "format": "\n--------\n"}, + "item": {"block_prefix": "• "}, + "enumeration": {"block_prefix": ". "}, + "task": {"ticked": "[āœ“] ", "unticked": "[ ] "}, + "link": {"color": "30", "underline": true}, + "link_text": {"color": "35", "bold": true}, + "image": {"color": "212", "underline": true}, + "image_text": {"color": "243", "format": "Image: {{.text}} →"}, + "code": {"prefix": " ", "suffix": " ", "color": "203", "background_color": "236"}, + "code_block": {"color": "244", "margin": 2}, + "table": {"color": "253"}, + "definition_list": {}, + "definition_term": {}, + "definition_description": {"block_prefix": "\n🠶 "}, + "html_block": {}, + "html_span": {} +} diff --git a/files/shell/functions/dfh b/files/shell/functions/dfh index 704e5cd..1e22afc 100644 --- a/files/shell/functions/dfh +++ b/files/shell/functions/dfh @@ -21,8 +21,13 @@ dfh() { return 1 fi - if command -v bat &>/dev/null; then - bat --language=md --style=header,grid --color=always "$page" + if command -v glow &>/dev/null; then + local style="$HOME/.config/glow/style.json" + if [[ -f "$style" ]]; then + CLICOLOR_FORCE=1 glow --style "$style" "$page" | LESSCHARSET=utf-8 less -R + else + glow "$page" | LESSCHARSET=utf-8 less -R + fi else cat "$page" fi diff --git a/scripts/10_setup_zsh.sh b/scripts/10_setup_zsh.sh index 773245b..1227318 100755 --- a/scripts/10_setup_zsh.sh +++ b/scripts/10_setup_zsh.sh @@ -25,6 +25,8 @@ cp -f "$DOT_ROOT/files/zsh/completions/"* "$HOME/.zsh/completions/" cp -f "$DOT_ROOT/files/shell/functions/"* "$HOME/.zsh/functions/" cp -f "$DOT_ROOT/files/shell/aliases" "$HOME/.zsh/aliases" cp -f "$DOT_ROOT/files/help/"* "$HOME/.dotfiles-help/" +mkdir -p "$HOME/.config/glow" +cp -f "$DOT_ROOT/files/glow/style.json" "$HOME/.config/glow/style.json" git -C "$DOT_ROOT" log -1 --format="%h %ad" --date=short >"$HOME/.dotfiles-version" # update remote dependencies