mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-26 03:04:06 +00:00
feat: switch from starship to oh-my-posh
This commit is contained in:
BIN
.github/screenshots/oh-my-posh.png
vendored
Normal file
BIN
.github/screenshots/oh-my-posh.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
@@ -95,5 +95,6 @@ TMUX_WINDOW_NAME_PLUGIN="$DOTFILES/config/tmux/plugins/tmux-window-name/scripts/
|
||||
add-zsh-hook chpwd tmux-window-name
|
||||
}
|
||||
|
||||
eval "$(starship init zsh)"
|
||||
# eval "$(starship init zsh)"
|
||||
eval "$(oh-my-posh init zsh --config $XDG_CONFIG_HOME/oh-my-posh.omp.json)"
|
||||
source "$DOTFILES/config/alias"
|
||||
|
||||
150
config/oh-my-posh.omp.json
Normal file
150
config/oh-my-posh.omp.json
Normal file
@@ -0,0 +1,150 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
|
||||
"final_space": true,
|
||||
"shell_integration": true,
|
||||
"console_title_template": "{{.UserName}}@{{.HostName}} {{.Shell}} in {{.PWD}}",
|
||||
"blocks": [
|
||||
{
|
||||
"alignment": "left",
|
||||
"segments": [
|
||||
{
|
||||
"foreground": "cyan",
|
||||
"style": "powerline",
|
||||
"template": "{{ .Icon }}",
|
||||
"type": "os"
|
||||
},
|
||||
{
|
||||
"type": "session",
|
||||
"style": "plain",
|
||||
"template": " {{ if .SSHSession }} {{ .UserName }}@{{ end }}{{ .HostName }}"
|
||||
},
|
||||
{
|
||||
"foreground": "cyan",
|
||||
"properties": {
|
||||
"style": "mixed"
|
||||
},
|
||||
"style": "plain",
|
||||
"template": " {{ .Path }} ",
|
||||
"type": "path",
|
||||
"mapped_locations": {
|
||||
"~/Code/*": "\uF09B"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "git",
|
||||
"style": "plain",
|
||||
"foreground": "lightGreen",
|
||||
"template": "git({{ .UpstreamIcon }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} {{ .StashCount }}{{ end }})",
|
||||
"properties": {
|
||||
"fetch_status": true,
|
||||
"fetch_upstream_icon": true,
|
||||
"untracked_modes": {
|
||||
"~/Code/oh-my-posh/": "no"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "terraform",
|
||||
"style": "plain",
|
||||
"foreground": "#000000",
|
||||
"background": "#ebcc34",
|
||||
"template": "{{.WorkspaceName}}"
|
||||
}
|
||||
],
|
||||
"type": "prompt"
|
||||
},
|
||||
{
|
||||
"alignment": "left",
|
||||
"segments": [
|
||||
{
|
||||
"foreground": "#68a063",
|
||||
"properties": {
|
||||
"display_mode": "files",
|
||||
"fetch_package_manager": true,
|
||||
"fetch_version": true
|
||||
},
|
||||
"style": "plain",
|
||||
"template": " {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }}",
|
||||
"type": "node"
|
||||
},
|
||||
{
|
||||
"foreground": "#4063D8",
|
||||
"properties": {
|
||||
"display_mode": "files",
|
||||
"fetch_version": true
|
||||
},
|
||||
"style": "plain",
|
||||
"template": " {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}",
|
||||
"type": "crystal"
|
||||
},
|
||||
{
|
||||
"foreground": "#DE3F24",
|
||||
"properties": {
|
||||
"display_mode": "files",
|
||||
"fetch_version": true
|
||||
},
|
||||
"style": "plain",
|
||||
"template": " {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}",
|
||||
"type": "ruby"
|
||||
},
|
||||
{
|
||||
"foreground": "#FED142",
|
||||
"properties": {
|
||||
"display_mode": "context",
|
||||
"fetch_virtual_env": false
|
||||
},
|
||||
"style": "plain",
|
||||
"template": " {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}",
|
||||
"type": "python"
|
||||
},
|
||||
{
|
||||
"type": "php",
|
||||
"style": "plain",
|
||||
"template": " {{ .Full }} "
|
||||
}
|
||||
],
|
||||
"type": "prompt"
|
||||
},
|
||||
{
|
||||
"alignment": "left",
|
||||
"newline": true,
|
||||
"segments": [
|
||||
{
|
||||
"background": "transparent",
|
||||
"foreground": "lightGreen",
|
||||
"foreground_templates": ["{{ if gt .Code 0 }}red{{ end }}"],
|
||||
"properties": {
|
||||
"always_enabled": true
|
||||
},
|
||||
"style": "plain",
|
||||
"template": "\u279c",
|
||||
"type": "status"
|
||||
}
|
||||
],
|
||||
"type": "prompt"
|
||||
}
|
||||
],
|
||||
"transient_prompt": {
|
||||
"background": "transparent",
|
||||
"foreground": "lightGreen",
|
||||
"foreground_templates": ["{{ if gt .Code 0 }}red{{ end }}"],
|
||||
"template": "\u279c "
|
||||
},
|
||||
"tooltips": [
|
||||
{
|
||||
"type": "git",
|
||||
"tips": ["git", "g"],
|
||||
"style": "diamond",
|
||||
"foreground": "#193549",
|
||||
"background": "#fffb38",
|
||||
"leading_diamond": "",
|
||||
"trailing_diamond": "",
|
||||
"template": "{{ .HEAD }}{{ if .Staging.Changed }} {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} {{ .Working.String }}{{ end }}",
|
||||
"properties": {
|
||||
"fetch_status": true,
|
||||
"fetch_upstream_icon": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"version": 2
|
||||
}
|
||||
@@ -61,6 +61,7 @@ function section_install
|
||||
$0 install fonts
|
||||
$0 install antigen
|
||||
$0 brew install
|
||||
$0 install ohmyposh
|
||||
$0 install ohmybash
|
||||
$0 install pip
|
||||
$0 install cargo
|
||||
@@ -185,6 +186,11 @@ function section_install
|
||||
bash "$DOTFILES/scripts/install-ohmybash.sh" \
|
||||
&& msg_yay "oh-my-bash installed!"
|
||||
;;
|
||||
ohmyposh)
|
||||
msg "oh-my-posh install started..."
|
||||
bash "$DOTFILES/scripts/install-ohmyposh.sh" \
|
||||
&& msg_yay "oh-my-posh installed!"
|
||||
;;
|
||||
pip)
|
||||
msg "pip install started..."
|
||||
bash "$DOTFILES/scripts/install-pip-packages.sh"
|
||||
|
||||
@@ -26,7 +26,7 @@ rustup default system
|
||||
packages=(
|
||||
"cargo-cache"
|
||||
# starship.rs
|
||||
"starship"
|
||||
# "starship"
|
||||
# An incremental parsing system for programming tools
|
||||
"tree-sitter-cli"
|
||||
# a subprocess caching utility
|
||||
|
||||
18
scripts/install-ohmyposh.sh
Executable file
18
scripts/install-ohmyposh.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env zsh
|
||||
#
|
||||
# Install oh-my-posh
|
||||
#
|
||||
# shellcheck source=shared.sh
|
||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
curl -s https://ohmyposh.dev/install.sh | bash -s -- -d ~/.local/bin
|
||||
|
||||
OHMYPOSH_CFG="$HOME/.dotfiles/config/oh-my-posh.omp.json"
|
||||
|
||||
eval "$(oh-my-posh init zsh --config $OHMYPOSH_CFG)"
|
||||
|
||||
#cd ~/.dotfiles || exit
|
||||
#oh-my-posh config export image \
|
||||
# --config "$OHMYPOSH_CFG" \
|
||||
# --output "~/.dotfiles/.github/screenshots/oh-my-posh.png" \
|
||||
# --author "Ismo Vuorinen"
|
||||
Reference in New Issue
Block a user