Skip to content

A fish shell plugin that automatically adds OS-flavored symbols to your prompt.

License

Notifications You must be signed in to change notification settings

eholic/osflavor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

osflavor build License: MIT

A Fish prompt that automatically adds OS-flavored symbols to your prompt.

Installation

Install with Fisher.

$ fisher install eholic/osflavor

Usage

Use (__osflavor) to customize your ~/config/fish/functions/fish_prompt.fish.

Then osflavor will automatically uses OS-flavored symbols. Here's an example.

function fish_prompt
    set -g __osflavor_last_status $status # must be first line of code

    # the rest of your prompt...
    echo -n -s (__osflavor) (__fish_git_prompt " %s") ' '
end

If you are using Nerd Font

You can use a single character os icon by adding the following option in your ~/.config/fish/config.fish.

set -g __osflavor_use_nerd_font_icon 1
# must be before using (__osflavor)

🙏 I got all definitions from IlanCosman/tide.

For other prompt user

Add the following option in your ~/.config/fish/config.fish.

set -g tide_character_icon (__osflavor)
set -g pure_symbol_prompt (__osflavor) 
set -g hydro_symbol_prompt (__osflavor)

Pre-defined Distributions

Default symbols are defined in conf.d/osflavor.fish and conf.d/__osflavor_nerd.fish.

If you want to change the default symbols, see Customization.

  • osflavor list lists pre-defined symbols.
  • osflavor set <name> sets prompt as the other distribution.
  • osflavor set clears above set <name>.

Customization

The prompt symbols for each distribution can be specified using __osflavor_dist_<name>(global variable).

<name> should be a lowercased substring contained within uname -a.

# ~/.config/fish/config.fish

set -g __osflavor_dist_xlinxmint (set_color red)">"

# Overwrite pre-defined symbols.
set -g __osflavor_dist_darwin ">"
set -g __osflavor_dist_centos (set_color 9ccd2a)""(set_color a14f8c)""(set_color efa724)""(set_color 262577)""

About

A fish shell plugin that automatically adds OS-flavored symbols to your prompt.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages