Skip to content

Instantly share code, notes, and snippets.

@moelife-coder
Created June 26, 2020 09:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moelife-coder/0b47c1ae703bcefb5dfe05d7b109f0c7 to your computer and use it in GitHub Desktop.
Save moelife-coder/0b47c1ae703bcefb5dfe05d7b109f0c7 to your computer and use it in GitHub Desktop.
# Add Fira Code Font to code-server.
# Place it under '/etc/pacman.d/hooks/' and reinstall code-server from AUR.
# Changing to any fonts by replacing 'https://cdn.jsdelivr.net/gh/tonsky/FiraCode@4/distr/fira_code.css' url should work.
[Trigger]
Operation = Upgrade
Operation = Install
Type = Package
Target = code-server
[Action]
Description = Adding Fira Code font for code-server
When = PostTransaction
Exec = /usr/bin/bash -c 'fira_code_css=$(curl -s 'https://cdn.jsdelivr.net/gh/tonsky/FiraCode@4/distr/fira_code.css'); org_css=$(cat /usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.css); (echo "${fira_code_css}"; echo "${org_css}") > /usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.css; if [ ! -d /usr/lib/code-server/lib/vscode/out/vs/workbench/woff ]; then mkdir /usr/lib/code-server/lib/vscode/out/vs/workbench/woff /usr/lib/code-server/lib/vscode/out/vs/workbench/woff2; fi; echo "${fira_code_css}" | while read line; do real_url="${line##*url??}"; real_url="${real_url%%???format*}"; if [ "${real_url}" != "${line}" ]; then echo "Downloading ${real_url}"; curl -s -o "/usr/lib/code-server/lib/vscode/out/vs/workbench/${real_url}" "https://cdn.jsdelivr.net/gh/tonsky/FiraCode@4/distr/${real_url}"; fi; done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment