oh-my-fish_theme-bobthefish/functions/__bobthefish_glyphs.fish
Bojan Čekrlić 0ca9a1df71 Add OS type detection and custom coloring for root user
This commit includes these new features:
- *A segment which displays OS type.* This is especially useful
  if constantly logging into different computers with different
  systems and you need to know if you need to type `apk`, `apt`,
  `dnf`, or `yum`, for example. Enable it by setting the
  `theme_display_currentos` variable to `yes`.
- *Padlock for SSH connection.* You may enable the padlock by
  setting the `theme_display_ssh_keylock` to `yes`. Padlock is
  shown only when accessing the terminal via a SSH session.
  The padlock is displayed _before_ the hostname.
- *Split username and hostname segments.* This enable each segment
  to be coloured with a different background. Set
  `theme_display_split_user_hostname` to `yes` to enable this
  feature.
- *Color root username differently.* When logged in as a `root`
  user, background (or the color of the username) will change
  to red. New colour has been added to the theme(s) for this
  feature.
2019-11-21 17:48:53 +01:00

129 lines
4.1 KiB
Fish
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function __bobthefish_glyphs -S -d 'Define glyphs used by bobthefish'
# Powerline glyphs
set -x branch_glyph \uE0A0
set -x right_black_arrow_glyph \uE0B0
set -x right_arrow_glyph \uE0B1
set -x left_black_arrow_glyph \uE0B2
set -x left_arrow_glyph \uE0B3
# Additional glyphs
set -x detached_glyph \u27A6
set -x tag_glyph \u2302
set -x nonzero_exit_glyph '! '
set -x superuser_glyph '$ '
set -x bg_job_glyph '% '
set -x hg_glyph \u263F
# Python glyphs
set -x superscript_glyph \u00B9 \u00B2 \u00B3
set -x virtualenv_glyph \u25F0
set -x pypy_glyph \u1D56
set -x ruby_glyph ''
set -x go_glyph ''
# Desk glyphs
set -x desk_glyph \u25F2
# Kubernetes glyphs
set -x k8s_glyph \u2388 # '⎈'
# Vagrant glyphs
set -x vagrant_running_glyph \u2191 # ↑ 'running'
set -x vagrant_poweroff_glyph \u2193 # ↓ 'poweroff'
set -x vagrant_aborted_glyph \u2715 # ✕ 'aborted'
set -x vagrant_saved_glyph \u21E1 # ⇡ 'saved'
set -x vagrant_stopping_glyph \u21E3 # ⇣ 'stopping'
set -x vagrant_unknown_glyph '!' # strange cases
# Git glyphs
set -x git_dirty_glyph '*'
set -x git_staged_glyph '~'
set -x git_stashed_glyph '$'
set -x git_untracked_glyph '…'
set -x git_ahead_glyph \u2191 # '↑'
set -x git_behind_glyph \u2193 # '↓'
set -x git_plus_glyph '+'
set -x git_minus_glyph '-'
set -x git_plus_minus_glyph '±'
# Disable Powerline fonts (unless we're using nerd fonts instead)
if [ "$theme_powerline_fonts" = "no" -a "$theme_nerd_fonts" != "yes" ]
set branch_glyph \u2387
set right_black_arrow_glyph ''
set right_arrow_glyph ''
set left_black_arrow_glyph ''
set left_arrow_glyph ''
end
set os_type_darwin 'Mac'
set os_type_synology 'Syno'
set os_type_mint 'Mint'
set os_type_suse 'Suse'
set os_type_centos 'Cent'
set os_type_fedora 'Fed'
set os_type_redhat 'RHat'
set os_type_gentoo 'Gnto'
set os_type_arch 'Arch'
set os_type_alpine 'Alp'
set os_type_ubuntu 'Ubu'
set os_type_elementary 'Elem'
set os_type_debian 'Deb'
set os_type_generic 'Lin'
set os_type_amazon 'Amz'
set os_type_coreos 'Core'
# Use prettier Nerd Fonts glyphs
if [ "$theme_nerd_fonts" = "yes" ]
set branch_glyph \uF418
set detached_glyph \uF417
set tag_glyph \uF412
set virtualenv_glyph \uE73C ' '
set ruby_glyph \uE791 ' '
set go_glyph \uE626 ' '
set node_glyph \uE718 ' '
set vagrant_running_glyph \uF431 # ↑ 'running'
set vagrant_poweroff_glyph \uF433 # ↓ 'poweroff'
set vagrant_aborted_glyph \uF468 # ✕ 'aborted'
set vagrant_unknown_glyph \uF421 # strange cases
set git_dirty_glyph \uF448 '' # nf-oct-pencil
set git_staged_glyph \uF0C7 '' # nf-fa-save
set git_stashed_glyph \uF0C6 '' # nf-fa-paperclip
set git_untracked_glyph \uF128 '' # nf-fa-question
# set git_untracked_glyph \uF141 '' # nf-fa-ellipsis_h
set git_ahead_glyph \uF47B # nf-oct-chevron_up
set git_behind_glyph \uF47C # nf-oct-chevron_down
set git_plus_glyph \uF0DE # fa-sort-asc
set git_minus_glyph \uF0DD # fa-sort-desc
set git_plus_minus_glyph \uF0DC # fa-sort
set os_type_darwin ''
set os_type_synology ''
set os_type_mint ''
set os_type_suse ''
set os_type_centos ''
set os_type_fedora ''
set os_type_redhat ''
set os_type_gentoo ''
set os_type_arch ''
set os_type_alpine ''
set os_type_ubuntu ''
set os_type_elementary ''
set os_type_debian ''
set os_type_generic ''
set os_type_amazon ''
set os_type_coreos ''
end
# Avoid ambiguous glyphs
if [ "$theme_avoid_ambiguous_glyphs" = "yes" ]
set git_untracked_glyph '...'
end
end