Created
June 26, 2020 09:13
-
-
Save moelife-coder/0b47c1ae703bcefb5dfe05d7b109f0c7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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