Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Userwithaname/fin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

201 Commits

Repository files navigation

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! πŸ˜„

About Fin

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".

Usage

  • fin install [fonts] - installs the specified fonts
  • fin update [fonts (optional)] - updates your installed fonts
  • fin remove [fonts] - removes the specified fonts
  • fin 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.

Installers

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.

Example installers

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

Installer fields

This is the full list of fields available to installers:

  • name

    The name of the font, used as the installation directory

  • source

    Where to obtain the font from

    • [source.GitHub]

      Download releases of a GitHub project

      • tag

        Tag/version of the font to install (optional, defaults to "latest")

      • author

        GitHub project author

      • project

        GitHub project name

    • [source.Webpage]

      Download from a webpage

      • tag

        Arbitrary value (optional unless other fields use $tag)

      • url

        Download page URL, which must contain a download link to file within its source

    • [source.Direct]

      Specify a direct link to file

      • tag

        Arbitrary value (optional unless other fields use $tag)

      • url

        Note: The URL must end with $file

      Note: Direct links cannot currently detect updates except by manually changing the url

  • action

    Specify what to do with the file

    • [action.Extract]

      Use to extract files from the $file archive

      • file

        Name of the file to download and extract from (supports wildcards, except for direct links)

      • include

        Specify which files within the archive to install

      • exclude

        Specify which files to ignore (optional: takes precedence over include, defaults to none)

      • keep_folders

        Follow the same directory structure as the archive (optional, defaults to false)

      Note: The include and exclude fields support wildcards

    • [action.SingleFile]

      Use to install the downloaded file with no processing action

      • file

        Name of the file to download (supports wildcards)

  • check

    Optionally 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

      • file

        The checksum file to download (optional)

    Note: Not supported for direct download links

Configuration

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

Building from source

  1. Install Rust and Cargo
  2. Clone this repository: git clone https://github.com/Userwithaname/fin.git
  3. Enter the cloned directory: cd fin
  4. 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 $PATH in order to use it.

To learn more about the build process, see the Cargo documentation for cargo build and cargo install.

About

Install and manage fonts from your terminal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /