Fixup the font selector

This commit is contained in:
David Heinemeier Hansson 2024-06-03 14:31:35 -07:00
parent 4bc282ec6a
commit 95dda8b1b0
3 changed files with 21 additions and 14 deletions

View File

@ -1,20 +1,19 @@
#!/bin/bash #!/bin/bash
set -e set -e
mkdir -p ~/.local/share/fonts # Pick a preconfigured theme
FONT=$(gum choose "Cascadia Mono" "Fira Mono" "JetBrains Mono" "Meslo" | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g')
# Pick a preselected font if [ "$FONT" == "cascadia-mono" ]; then
NERD_FONT="CaskaydiaMono Nerd Font"
if ! [ -f "$HOME/.local/share/fonts/CaskaydiaMonoNerdFont-Regular.ttf" ]; then elif [ "$FONT" == "fira-mono" ]; then
cd ~/Downloads NERD_FONT="FiraMono Nerd Font"
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/CascadiaMono.zip elif [ "$FONT" == "jetbrains-mono" ]; then
unzip CascadiaMono.zip -d CascadiaFont NERD_FONT="JetBrainsMono NFM"
mkdir -p ~/.local/share/fonts elif [ "$FONT" == "meslo" ]; then
cp CascadiaFont/*.ttf ~/.local/share/fonts NERD_FONT="MesloLGLDZ Nerd Font"
rm -rf CascadiaMono.zip CascadiaFont
fc-cache
cd -
fi fi
# Replace font = { family: X } gsettings set org.gnome.desktop.interface monospace-font-name "$NERD_FONT 10"
gsettings set org.gnome.desktop.interface monospace-font-name 'CaskaydiaMono Nerd Font 10' cp $OMAKUB_PATH/fonts/alacritty/$FONT.toml ~/.config/alacritty/font.toml
sed -i "s/\"editor.fontFamily\": \".*\"/\"editor.fontFamily\": \"$NERD_FONT\"/g" ~/.config/Code/User/settings.json

View File

@ -0,0 +1,4 @@
[font]
normal = { family = "JetBrainsMono Nerd Font", style = "Regular" }
bold = { family = "JetBrainsMono Nerd Font", style = "Bold" }
italic = { family = "JetBrainsMono Nerd Font", style = "Italic" }

View File

@ -0,0 +1,4 @@
[font]
normal = { family = "MesloLGLDZ Nerd Font", style = "Regular" }
bold = { family = "MesloLGLDZ Nerd Font", style = "Bold" }
italic = { family = "MesloLGLDZ Nerd Font", style = "Italic" }