Skip to content

Commit

Permalink
OMP update (From source)
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkXero-dev committed Jul 26, 2024
1 parent f7871ca commit 7262357
Show file tree
Hide file tree
Showing 3 changed files with 195 additions and 169 deletions.
156 changes: 0 additions & 156 deletions Configs/Home/.config/ohmyposh/easy-term.omp.json

This file was deleted.

152 changes: 152 additions & 0 deletions Configs/Home/.config/ohmyposh/tokyonight_storm.omp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"console_title_template": " {{ .Folder }} :: {{if .Root}}Admin{{end}}",
"palette": {
"main-bg": "#24283b",
"terminal-red": "#f7768e",
"pistachio-green": "#9ece6a",
"terminal-green": "#73daca",
"terminal-yellow": "#e0af68",
"terminal-blue": "#7aa2f7",
"celeste-blue": "#b4f9f8",
"light-sky-blue": "#7dcfff",
"terminal-white": "#c0caf5",
"white-blue": "#a9b1d6",
"blue-bell": "#9aa5ce",
"pastal-grey": "#cfc9c2",
"terminal-magenta": "#bb9af7",
"blue-black": "#565f89",
"terminal-black": "#414868",
"t-background": "p:main-bg"
},
"blocks": [
{
"alignment": "left",
"segments": [
{
"type": "text",
"style": "plain",
"background": "transparent",
"foreground": "p:terminal-blue",
"template": "\u279c "
},
{
"type": "path",
"style": "plain",
"foreground": "p:terminal-magenta",
"properties": {
"style": "folder"
},
"template": "<b>{{ .Path }}</b> <p:light-sky-blue>\u26a1</>"
},
{
"type": "git",
"style": "plain",
"foreground": "p:light-sky-blue",
"foreground_templates": [
"{{ if or (.Working.Changed) (.Staging.Changed) }}p:terminal-red{{ end }}",
"{{ if and (gt .Ahead 0) (gt .Behind 0)}}p:light-sky-blue {{ end }}",
"{{ if gt .Ahead 0 }}p:terminal-blue{{ end }}",
"{{ if gt .Behind 0 }}p:celeste-blue{{ end }}"
],
"auto_upgrade": {
"type": "boolean",
"title": "Enable automatic upgrades for Oh My Posh (supports Windows/macOS only)",
"description": "https://ohmyposh.dev/docs/configuration/general#general-settings",
"default": false
},
"template": "({{ .HEAD}})",
"properties": {
"fetch_status": true,
"branch_icon": "\ue725 "
}
},
{
"type": "status",
"style": "plain",
"foreground": "p:terminal-red",
"template": " \uf00d"
}
],
"type": "prompt"
},
{
"alignment": "right",
"overflow": "hide",
"segments": [
{
"type": "node",
"style": "plain",
"foreground": "p:pistachio-green",
"template": "\ue718 {{ .Full }} "
},
{
"type": "php",
"style": "plain",
"foreground": "p:terminal-blue",
"template": "\ue73d {{ .Full }} "
},
{
"type": "python",
"style": "plain",
"foreground": "p:terminal-yellow",
"template": "\uE235 {{ .Full }}"
},
{
"type": "julia",
"style": "plain",
"foreground": "p:terminal-magenta",
"template": "\uE624 {{ .Full }}"
},
{
"type": "ruby",
"style": "plain",
"foreground": "p:terminal-red",
"template": "\uE791 {{ .Full}}"
},
{
"type": "go",
"style": "plain",
"foreground": "p:light-sky-blue",
"template": "\uFCD1 {{ .Full}}"
},
{
"type": "command",
"style": "plain",
"foreground": "p:white-blue",
"properties": {
"command": "git log --pretty=format:%cr -1 || date +%H:%M:%S",
"shell": "bash"
}
}
],
"type": "prompt"
},
{
"alignment": "left",
"newline": true,
"segments": [
{
"foreground": "p:pistachio-green",
"style": "plain",
"template": "\u25b6",
"type": "text"
}
],
"type": "prompt"
}
],
"secondary_prompt": {
"background": "transparent",
"foreground": "p:terminal-blue",
"template": "\u279c "
},
"transient_prompt": {
"background": "p:t-background",
"foreground": "p:terminal-blue",
"template": "\u279c "
},
"final_space": true,
"version": 2,
"terminal_background": "p:t-background"
}
56 changes: 43 additions & 13 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ else
exit 1
fi
# Install packages using the detected AUR helper
$aur_helper -S --noconfirm --needed ttf-meslo-nerd-font-powerlevel10k oh-my-posh-bin
$aur_helper -S --noconfirm --needed ttf-meslo-nerd-font-powerlevel10k
sleep 2
echo
echo "Creating Backup & Applying new Rice, hold on..."
Expand Down Expand Up @@ -75,19 +75,49 @@ case "$response" in
esac
sleep 2
echo
echo "Applying OhMy-Posh to Bash"
echo "Oh-My-Posh Setup."
echo
# Check if the folder exists, if not create it and download the file
if [ ! -d "$HOME/.config/ohmyposh" ]; then
mkdir -p "$HOME/.config/ohmyposh"
fi
curl -o "$HOME/.config/ohmyposh/tokyonight_storm.omp.json" https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/tokyonight_storm.omp.json
sleep 2
# Check if the line exists in ~/.bashrc, if not add it
if ! grep -Fxq 'eval "$(oh-my-posh init bash --config $HOME/.config/ohmyposh/tokyonight_storm.omp.json)"' "$HOME/.bashrc"; then
echo '' >> "$HOME/.bashrc"
echo 'eval "$(oh-my-posh init bash --config $HOME/.config/ohmyposh/tokyonight_storm.omp.json)"' >> "$HOME/.bashrc"
fi
echo "Installing Oh-My-Posh"
curl -s https://ohmyposh.dev/install.sh | bash -s
echo
sleep 3
echo "Injecting OMP to .bashrc"

# Define the lines to be added
line1='# Oh-My-Posh'
line2='PATH="$HOME/.local/bin:$PATH"'
line3='# Oh-My-Posh Config'
line4='eval "$(oh-my-posh init bash --config $HOME/.config/ohmyposh/tokyonight_storm.omp.json)"'

# Define the .bashrc file
bashrc_file="$HOME/.bashrc"

# Function to add lines if not already present
add_lines() {
if ! grep -qxF "$line1" "$bashrc_file"; then
echo "" >> "$bashrc_file" # Add an empty line before line1
echo "$line1" >> "$bashrc_file"
fi

if ! grep -qxF "$line2" "$bashrc_file"; then
echo "$line2" >> "$bashrc_file"
echo "" >> "$bashrc_file" # Add an empty line after line2
fi

if ! grep -qxF "$line3" "$bashrc_file"; then
echo "$line3" >> "$bashrc_file"
fi

if ! grep -qxF "$line4" "$bashrc_file"; then
echo "$line4" >> "$bashrc_file"
fi
}

# Run the function to add lines
add_lines

echo "Oh-My-Posh injection complete."
sleep 3
echo
echo "Applying Grub Theme...."
echo "#######################"
Expand Down

0 comments on commit 7262357

Please sign in to comment.