githubnext / monaspace

An innovative superfamily of fonts for code
https://monaspace.githubnext.com
SIL Open Font License 1.1
13.18k stars 220 forks source link

Merge Linux and Mac Install Script + Fixes + Messages #64

Open abeljim opened 7 months ago

abeljim commented 7 months ago

Fixes #63 Install script is now a single file for mac and Linux. Handles XDG_DATA_HOME if available. Prints out progress messages for the user. Updated ReadMe.

Finii commented 7 months ago

In principle it could use the XDG_DATA_HOME also, instead of assuming where share/fonts is, for people who have a different directory layout.

# Get target root directory
if [[ $(uname) == 'Darwin' ]]; then
  # MacOS
  sys_share_dir="/Library"
  usr_share_dir="$HOME/Library"
  font_subdir="Fonts"
else
  # Linux
  sys_share_dir="/usr/local/share"
  usr_share_dir="$HOME/.local/share"
  font_subdir="fonts"
fi
if [ -n "${XDG_DATA_HOME}" ]; then
  usr_share_dir="${XDG_DATA_HOME}"
fi

Code snippet that allows Linux and MacOS installs, system-wide or user

https://wiki.archlinux.org/title/XDG_Base_Directory

Finii commented 7 months ago

Better fix is #66

abeljim commented 7 months ago

Updated script based on feedback. See first post for more info.

lucaspar commented 7 months ago

I'm seeing these PRs after writing my own modifications to this installation script too :sweat_smile:

IMO Monaspace should have its own directory in fonts e.g.: ${XDG_DATA_HOME}/fonts/Monaspace/, as over 200 files are copied there by this script.

idan commented 1 month ago

Hi there! This seems way nicer than our crappy install scripts, but I don't want to hold up releasing v1.101 for it. Going to figure this out for 1.2, alongside #89. Stay tuned!