Caution
This software is still in active development, and may or may not maintain backward/forward compatibility. Some configurations may be untested.
Note
Fin is a learning project, and my first actual project written in Rust. As such, the code quality may not be up-to-par with your expectations. Feel free to try it in a VM, report the issues you encounter, share ideas, suggest improvements, etc, etc. Enjoy and have fun! π
Fin is a font manager which allows you to install and manage fonts using
custom installers. Installers tell Fin where each font can be obtained
from and how to install it. This allows fonts to be installed directly
from the source (such as release assets of GitHub repositories).
Fonts can be managed using the install/update/remove commands.
"Fin" is a contraction of "font installer".
fin install [fonts]- installs the specified fontsfin update [fonts (optional)]- updates your installed fontsfin remove [fonts]- removes the specified fontsfin help [action]- help messages for each action
See the output of fin help for more information:
$ fin help
Usage:
fin [action] [items]
Actions:
install Install new fonts
reinstall Reinstall fonts
update Update installed fonts
remove Remove installed fonts
list List installed or available fonts
clean Remove temporary cache files
config Manage the configuration file
version Show the current version number
help Show help for any action
Arguments:
--refresh -r Ignore cache and fetch new data
--no-refresh -c Do not fetch new data if possible
--reinstall -i Skip version checks and reinstall
--verbose -v Show more detailed output
--force -F Forcefully perform action (unsafe)
--yes -y Automatically accept prompts
--no -n Automatically reject prompts
Note that you will also need an installer for any font you wish to install.
Fin relies on TOML files (located in ~/.config/fin/installers/) to specify
how each font should be installed. Installers allow Fin to download fonts and
install them on your system.
A file in ~/.config/fin/installers/ named maple-mono with the following
contents would enable Fin to install the latest release of
Maple Mono directly from GitHub
by running fin install maple-mono, and keep it updated using fin update:
name = "Maple Mono" [source.GitHub] tag = "latest" author = "subframe7536" project = "maple-font" [action.Extract] file = "MapleMono-Variable.zip" include = [ "LICENSE.txt", "*.ttf" ] [check.SHA256] file = "MapleMono-Variable.sha256"
Fin is able to install from other sources as well. For example, GeistMono Nerd Font from the Nerd Fonts website:
name = "GeistMono Nerd Font" [source.Webpage] url = "https://www.nerdfonts.com/font-downloads" [action.Extract] file = "GeistMono.zip" include = [ "*" ]
Note
See the installers/ directory of this repository for more examples
This is the full list of fields available to installers:
nameThe name of the font, used as the installation directory
sourceWhere to obtain the font from
[source.GitHub]Download releases of a GitHub project
tagTag/version of the font to install (optional, defaults to "latest")
authorGitHub project author
projectGitHub project name
[source.Webpage]Download from a webpage
tagArbitrary value (optional unless other fields use
$tag)urlDownload page URL, which must contain a download link to
filewithin its source
[source.Direct]Specify a direct link to
filetagArbitrary value (optional unless other fields use
$tag)urlNote: The URL must end with
$file
Note: Direct links cannot currently detect updates except by manually changing the
url
actionSpecify what to do with the file
[action.Extract]Use to extract files from the
$filearchivefileName of the file to download and extract from (supports wildcards, except for direct links)
includeSpecify which files within the archive to install
excludeSpecify which files to ignore (optional: takes precedence over
include, defaults to none)keep_foldersFollow the same directory structure as the archive (optional, defaults to
false)
Note: The
includeandexcludefields support wildcards[action.SingleFile]Use to install the downloaded file with no processing action
fileName of the file to download (supports wildcards)
checkOptionally specify an integrity check method
[check.SHA224]/[check.SHA256]/[check.SHA384]/[check.SHA512]Specify the file on the webpage containing the checksum string, or leave unspecified to look for the checksum within the page contents
fileThe checksum file to download (optional)
Note: Not supported for direct download links
Fin can be configured using the config.toml file located in
~/.config/fin/.
Running fin config write-default will create the following default
configuration:
# Location where new fonts will be installed # Override: --install-dir=[path] install_dir = "~/.local/share/fonts" # How long (in minutes) until cache is considered outdated # Override: --cache-timeout=[time] # Related: --refresh, --no-refresh cache_timeout = 90 # Show verbose output by default # Enable: --verbose # Disable: --no-verbose verbose_mode = false # Show verbose output when adding or removing files # Enable: --verbose-files, --verbose # Disable: --no-verbose-files, --no-verbose verbose_files = false # Show installed paths when running the list command # Enable: --verbose-list, --verbose # Disable: --no-verbose-list, --no-verbose verbose_list = false # Show URLs in the output # Enable: --verbose-urls, --verbose # Disable: --no-verbose-urls, --no-verbose verbose_urls = false
- Install Rust and Cargo
- Clone this repository:
git clone https://github.com/Userwithaname/fin.git - Enter the cloned directory:
cd fin - To build and install it, run:
cargo install --path .This will install Fin to your Cargo bin directory (usually~/.cargo/bin). You may need to add the directory to your$PATHin order to use it.
To learn more about the build process, see the Cargo documentation for
cargo build
and cargo install.