1
0
mirror of https://github.com/danbee/dotfiles-local synced 2025-03-04 08:49:07 +00:00

Starship in ZSH with OS custom prompt

This commit is contained in:
Daniel Barber 2021-12-22 17:21:06 -06:00
parent acbedc62bb
commit a8143ba043
9 changed files with 50 additions and 4 deletions

21
bin/lib/os.rb Normal file
View File

@ -0,0 +1,21 @@
class OS
ICONS = {
"Darwin" => "",
"Linux" => "",
"FreeBSD" => "",
}
def os
"#{icon} #{name}"
end
private
def name
@os ||= `uname -s`.strip
end
def icon
ICONS[name]
end
end

View File

@ -1,5 +1,5 @@
require_relative "tools_file" require_relative "tools/file"
require_relative "tool_icons" require_relative "tools/icons"
class Tools class Tools
include ToolIcons include ToolIcons

5
bin/os Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env ruby
require_relative "lib/os"
puts OS.new.os

View File

@ -1,6 +1,6 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
require_relative "tools_lib/tools" require_relative "lib/tools"
tools = Tools.new tools = Tools.new
tools.list_tools tools.list_tools

View File

@ -1,3 +1,6 @@
fish_add_path /opt/homebrew/bin
fish_add_path /opt/homebrew/sbin
starship init fish | source starship init fish | source
source (brew --prefix)/opt/asdf/libexec/asdf.fish source (brew --prefix)/opt/asdf/libexec/asdf.fish

View File

@ -1,4 +1,4 @@
format="$all$directory$character" format="$all$custom$jobs$directory$character"
[character] [character]
success_symbol = "[](bold cyan)" success_symbol = "[](bold cyan)"
@ -13,6 +13,21 @@ symbol = " "
[aws] [aws]
symbol = " " symbol = " "
[python]
symbol = " "
[elixir]
symbol = " "
[custom.os]
disabled = false
command = "os"
style = "bold white"
format = "[$symbol($output )]($style)"
symbol = ""
when = "true"
shell = ["bash", "--noprofile", "--norc"]
[git_branch] [git_branch]
format = "[$symbol$branch]($style) " format = "[$symbol$branch]($style) "

View File

@ -56,3 +56,5 @@ if (( $+commands[thefuck] )); then
fi fi
export PATH="$HOME/.bin:$PATH" export PATH="$HOME/.bin:$PATH"
eval "$(starship init zsh)"