The attached installation script is a clean-up version of what I've been using for the past few years when installing fonts from a number of sources, including this repository (powerline/fonts) as well as others (like ryanoasis/nerd-fonts); I'm not sure if you'd want something this long to and bash-dependent to replace the simple sh script, but I'll enumerate the additional features here and let the community and yourself decide its merit.
Allows for a custom installation root by assigning the desired path to the INSTALL_FONT_ROOT_PATH environment variable. An example of installation using a custom target path would be INSTALL_FONT_ROOT_PATH=/custom/font/path ./install.bash.
The new script defaults to the more common ~/.fonts directory for installation on *nix.
Allows for passing more than one filter and expands what can be filtered. Prior, only a single filter could be passed to the script (like install.sh Ubuntu). This filter was was case-sensitive and only filtered based on the font file name. This new script allows for any number of filters (like install.bash ubuntu firamono [etc]) and is no longer case-sensitive. While this script also performs the filter search via the file name (for example passing furamono will continue to match the font file FuraMono-Bold Powerline.otf) it additionally performs the filter search via the directory the font is in (for example passing firamono will not match the file name but it will match the same file because of its path of FiraMono/FuraMono-Bold Powerline.otf).
Invokes sudo only if the non-sudo command fails and only where required for the script to work, so if one wants to install the fonts to the system path of /usr/share/fonts they can simply call INSTALL_FONT_ROOT_PATH=/usr/share/fonts ./install.bash without having to run the whole script with sudo and the script will automatically utilize sudo to copy the files.
Uses a more robust installation file path that aligns better with how many common *nix distros organize their fonts. For example, the current install script just throw all the font files into the determined font directory, whereas this script will use the font path <root>/<type>/<family>/<file>.<ext>. An example of a resolved target path is ~/.fonts/opentype/FiraMono/FuraMono-Bold-Powerline.otf. Below is a short description of the path placeholders used prior:
Font root: the requested or automatically determined installation root (such as ~/.fonts).
Font type: the font file type (extension) name (such as opentype, truetype, and pcf).
Font family: the font family name as determined by the folder structure (such as Ubuntu, or FiraMono, etc).
Font file: the font file name (such as FuraMono-Bold-Powerline, etc).
Font ext: the font file extension (such as otf, etc).
There may be a few other changes, but the above list covers the major, important distinctions this script has from the existing one.
Note: this is still a work in progress (for example, fc-cache isn't yet called and it has not been compatibility-tested with Darwin); do not merge as-is (I will update to remedy these issues if interest exists for this script's inclusion in the project).
The attached installation script is a clean-up version of what I've been using for the past few years when installing fonts from a number of sources, including this repository (
powerline/fonts
) as well as others (likeryanoasis/nerd-fonts
); I'm not sure if you'd want something this long to and bash-dependent to replace the simplesh
script, but I'll enumerate the additional features here and let the community and yourself decide its merit.INSTALL_FONT_ROOT_PATH
environment variable. An example of installation using a custom target path would beINSTALL_FONT_ROOT_PATH=/custom/font/path ./install.bash
.~/.fonts
directory for installation on *nix.install.sh Ubuntu
). This filter was was case-sensitive and only filtered based on the font file name. This new script allows for any number of filters (likeinstall.bash ubuntu firamono [etc]
) and is no longer case-sensitive. While this script also performs the filter search via the file name (for example passingfuramono
will continue to match the font fileFuraMono-Bold Powerline.otf
) it additionally performs the filter search via the directory the font is in (for example passingfiramono
will not match the file name but it will match the same file because of its path ofFiraMono/FuraMono-Bold Powerline.otf
)./usr/share/fonts
they can simply callINSTALL_FONT_ROOT_PATH=/usr/share/fonts ./install.bash
without having to run the whole script withsudo
and the script will automatically utilize sudo to copy the files.<root>/<type>/<family>/<file>.<ext>
. An example of a resolved target path is~/.fonts/opentype/FiraMono/FuraMono-Bold-Powerline.otf
. Below is a short description of the path placeholders used prior:root
: the requested or automatically determined installation root (such as~/.fonts
).type
: the font file type (extension) name (such asopentype
,truetype
, andpcf
).family
: the font family name as determined by the folder structure (such asUbuntu
, orFiraMono
, etc).file
: the font file name (such asFuraMono-Bold-Powerline
, etc).ext
: the font file extension (such asotf
, etc).There may be a few other changes, but the above list covers the major, important distinctions this script has from the existing one.
Note: this is still a work in progress (for example,
fc-cache
isn't yet called and it has not been compatibility-tested with Darwin); do not merge as-is (I will update to remedy these issues if interest exists for this script's inclusion in the project).