-
Notifications
You must be signed in to change notification settings - Fork 315
Closed
Milestone
Description
The util/install_linux.sh script is badly written and does not work properly.
Here is the fixed script:
#!/bin/bash
# if the folder does not exist, create the folder
mkdir -p $HOME/.local/share/fonts/monaspace
# remove all fonts from ~/.local/share/fonts that start with "Monaspace"
rm -rf $HOME/.local/share/fonts/monaspace/Monaspace*
# copy all fonts from ./otf to ~/.local/share/fonts
cp $HOME/monaspace/fonts/otf/* $HOME/.local/share/fonts/monaspace
# copy variable fonts from ./variable to ~/.local/share/fonts
cp $HOME/monaspace/fonts/variable/* $HOME/.local/share/fonts/monaspace
# Build font information caches
fc-cache -fChanges
- Now, if the folder
fontsdoes not exist, create the folder inside$HOME/.local/share/ - The script now creates a folder called
monaspaceto keep the files there, keeping thefontsfolder cleaner. - Now to copy the files, the direction of the folder is specified to avoid the
cp: cannot staterror - Now use
$HOMEto make it easier for the user to read the script.
Particularities
We assume that the script is executed from the home folder of your system. Otherwise, the script will fail. The script expects the folder monaspace to be in your $HOME folder.
Observations
If you want, you can delete the follow command:
# remove all fonts from ~/.local/share/fonts that start with "Monaspace".
rm -rf $HOME/.local/share/fonts/monaspace/Monaspace*And use cp -u instead. If you want to copy the file only if it is newer than the destination, invoke the command with the -u option, like this:
# copy all fonts from ./otf to ~/.local/share/fonts
cp -u $HOME/monaspace/fonts/otf/* $HOME/.local/share/fonts/monaspace
# copy variable fonts from ./variable to ~/.local/share/fonts
cp -u $HOME/monaspace/fonts/variable/* $HOME/.local/share/fonts/monaspaceAnd beyond
A script could be written to download and install automatically with a single .sh file.
#!/bin/bash
# download monaspace from github
git clone https://github.com/githubnext/monaspace.git
# create folders
mkdir -p $HOME/.local/share/fonts/monaspace
# remove all fonts from ~/.local/share/fonts that start with "Monaspace"
rm -rf $HOME/.local/share/fonts/monaspace/Monaspace*
# copy all fonts from ./otf to ~/.local/share/fonts
cp $HOME/monaspace/fonts/otf/* $HOME/.local/share/fonts/monaspace
# copy variable fonts from ./variable to ~/.local/share/fonts
cp $HOME/monaspace/fonts/variable/* $HOME/.local/share/fonts/monaspace
# Build font information caches
fc-cache -f
# after the install, delete the monaspace folder from your home folder
rm -rf ./monaspace¡Un saludo!
develop7, TaylorMichaelHall and tabrezdevelop7, croqaz and AndGuz
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done