diff --git a/src/cli/font.go b/src/cli/font.go index e3efd439..f94798ae 100644 --- a/src/cli/font.go +++ b/src/cli/font.go @@ -11,8 +11,6 @@ import ( ) var ( - user bool - // fontCmd can work with fonts fontCmd = &cobra.Command{ Use: "font [install|configure]", @@ -43,21 +41,8 @@ This command is used to install fonts and configure the font in your terminal. terminal.Init(env.Shell()) - // Windows users need to specify the --user flag if they want to install the font as user - // If the user does not specify the --user flag, the font will be installed as a system font - // and therefore we need to be administrator - system := env.Root() - if env.GOOS() == platform.WINDOWS && !user && !system { - fmt.Println(` - You need to be administrator to install a font as system font. - You can either run this command as administrator or specify the --user flag to install the font for your user only: + font.Run(fontName, env.Root()) - oh-my-posh font install --user - `) - return - } - - font.Run(fontName, system) return case "configure": fmt.Println("not implemented") @@ -70,5 +55,4 @@ This command is used to install fonts and configure the font in your terminal. func init() { RootCmd.AddCommand(fontCmd) - fontCmd.Flags().BoolVar(&user, "user", false, "install font as user") } diff --git a/website/docs/installation/fonts.mdx b/website/docs/installation/fonts.mdx index 4f728d0f..9f065a13 100644 --- a/website/docs/installation/fonts.mdx +++ b/website/docs/installation/fonts.mdx @@ -23,16 +23,10 @@ To see the icons displayed in Oh My Posh, **install** a [Nerd Font][nerdfonts], }> -Oh My Posh has a CLI to help you select and install a [Nerd Font][nerdfonts] (beta): +Oh My Posh has a CLI to help you select and install a [Nerd Font][nerdfonts]: -:::caution Windows -This command is best executed as admin so that fonts are installed system wide. -In case you have no admin rights, you can install the fonts by adding the `--user` flag. -Do know this can have side-effects when using certain applications. -::: - -:::info Linux -On Linux, when running as root, the fonts will be installed system-wide. +:::info +When running as root/administrator, the fonts will be installed system-wide. When running as a regular user, the fonts will be installed in the user's font directory. ::: @@ -49,12 +43,11 @@ oh-my-posh font install meslo -If you're using Homebrew, you can install Nerd Fonts directly: +If you're using Homebrew, you can search for and install Nerd Fonts directly: ```bash -brew search nerd-font # Search for font packages +brew search nerd-font -# EXAMPLE: Install the NF version of Fira Code brew install --cask font-fira-code-nerd-font ```