Merge pull request 'Starshipを用いてプロンプトをカスタマイズする' (#18) from use-starship-for-prompt into master

Reviewed-on: #18
This commit is contained in:
Kazuhiro MUSASHI 2022-08-07 11:45:31 +00:00
commit ee410103ac
4 changed files with 207 additions and 1 deletions

View File

@ -63,6 +63,9 @@ include_recipe './mc.rb'
# Install lsyncd command: # Install lsyncd command:
include_recipe './lsyncd.rb' include_recipe './lsyncd.rb'
# Install starship command:
include_recipe './starship.rb'
# recipes for Ubuntu 16.04 # recipes for Ubuntu 16.04
if node['platform_version'].to_f == 16.04 if node['platform_version'].to_f == 16.04
# ntp configurations # ntp configurations

View File

@ -0,0 +1,14 @@
# インストールスクリプトのダウンロード
execute 'wget -O /tmp/starship-install.sh https://starship.rs/install.sh' do
not_if 'test -e /usr/local/bin/starship'
end
execute 'chmod +x /tmp/starship-install.sh' do
not_if 'test -e /usr/local/bin/starship'
end
execute '/tmp/starship-install.sh -y' do
user 'root'
not_if 'test -e /usr/local/bin/starship'
end

View File

@ -0,0 +1,176 @@
[status]
disabled = false
[hostname]
ssh_symbol = " 🌏 "
[git_branch]
symbol = "🌱 "
format = '\[[$symbol$branch]($style)\]'
[git_status]
conflicted = "🏳"
ahead = "🏎💨"
behind = "😰"
diverged = "😵"
up_to_date = "✓"
untracked = "🤷"
stashed = "📦"
modified = "📝"
staged = '[++\($count\)](green)'
renamed = "👅"
deleted = "🗑"
[aws]
format = '\[[$symbol($profile)(\($region\))(\[$duration\])]($style)\]'
[c]
format = '\[[$symbol($version(-$name))]($style)\]'
[cmake]
format = '\[[$symbol($version)]($style)\]'
[cmd_duration]
format = '\[[⏱ $duration]($style)\]'
[cobol]
format = '\[[$symbol($version)]($style)\]'
[conda]
format = '\[[$symbol$environment]($style)\]'
[crystal]
format = '\[[$symbol($version)]($style)\]'
[daml]
format = '\[[$symbol($version)]($style)\]'
[dart]
format = '\[[$symbol($version)]($style)\]'
[deno]
format = '\[[$symbol($version)]($style)\]'
[docker_context]
format = '\[[$symbol$context]($style)\]'
[dotnet]
format = '\[[$symbol($version)(🎯 $tfm)]($style)\]'
[elixir]
format = '\[[$symbol($version \(OTP $otp_version\))]($style)\]'
[elm]
format = '\[[$symbol($version)]($style)\]'
[erlang]
format = '\[[$symbol($version)]($style)\]'
[gcloud]
format = '\[[$symbol$account(@$domain)(\($region\))]($style)\]'
[golang]
format = '\[[$symbol($version)]($style)\]'
[haskell]
format = '\[[$symbol($version)]($style)\]'
[helm]
format = '\[[$symbol($version)]($style)\]'
[hg_branch]
format = '\[[$symbol$branch]($style)\]'
[java]
format = '\[[$symbol($version)]($style)\]'
[julia]
format = '\[[$symbol($version)]($style)\]'
[kotlin]
format = '\[[$symbol($version)]($style)\]'
[kubernetes]
format = '\[[$symbol$context( \($namespace\))]($style)\]'
[lua]
format = '\[[$symbol($version)]($style)\]'
[memory_usage]
format = '\[$symbol[$ram( | $swap)]($style)\]'
[nim]
format = '\[[$symbol($version)]($style)\]'
[nix_shell]
format = '\[[$symbol$state( \($name\))]($style)\]'
[nodejs]
format = '\[[$symbol($version)]($style)\]'
[ocaml]
format = '\[[$symbol($version)(\($switch_indicator$switch_name\))]($style)\]'
[openstack]
format = '\[[$symbol$cloud(\($project\))]($style)\]'
[package]
format = '\[[$symbol$version]($style)\]'
[perl]
format = '\[[$symbol($version)]($style)\]'
[php]
format = '\[[$symbol($version)]($style)\]'
[pulumi]
format = '\[[$symbol$stack]($style)\]'
[purescript]
format = '\[[$symbol($version)]($style)\]'
[python]
format = '\[[${symbol}${pyenv_prefix}(${version})(\($virtualenv\))]($style)\]'
[raku]
format = '\[[$symbol($version-$vm_version)]($style)\]'
[red]
format = '\[[$symbol($version)]($style)\]'
[ruby]
format = '\[[$symbol($version)]($style)\]'
[rust]
format = '\[[$symbol($version)]($style)\]'
[scala]
format = '\[[$symbol($version)]($style)\]'
[spack]
format = '\[[$symbol$environment]($style)\]'
[sudo]
format = '\[[as $symbol]\]'
[swift]
format = '\[[$symbol($version)]($style)\]'
[terraform]
format = '\[[$symbol$workspace]($style)\]'
[time]
format = '\[[$time]($style)\]'
[username]
format = '\[[$user]($style)\]'
[vagrant]
format = '\[[$symbol($version)]($style)\]'
[vlang]
format = '\[[$symbol($version)]($style)\]'
[zig]
format = '\[[$symbol($version)]($style)\]'

View File

@ -36,7 +36,7 @@ end
# Deploy dot files: # Deploy dot files:
git '/home/kazu634/repo/dotfiles' do git '/home/kazu634/repo/dotfiles' do
repository 'https://github.com/kazu634/dotfiles.git' repository 'https://gitea.kazu634.com/kazu634/dotfiles.git'
user 'kazu634' user 'kazu634'
end end
@ -53,6 +53,19 @@ git '/home/kazu634/.zplug' do
user 'kazu634' user 'kazu634'
end end
# Starship config
directory '/home/kazu634/.config' do
owner 'kazu634'
group 'kazu634'
mode '0740'
end
remote_file '/home/kazu634/.config/starship.toml' do
owner 'kazu634'
group 'kazu634'
mode '0640'
end
# sudoers # sudoers
remote_file '/etc/sudoers.d/kazu634' do remote_file '/etc/sudoers.d/kazu634' do
owner 'root' owner 'root'