
Catppuccin for Oh My Posh
This fork was created to better suit my personal preferences and my specific NixOS system setup.
- NixOS Optimization: Removed redundant Docker socket information (e.g.,
unix:///run/user/1000/docker.sock) to provide a cleaner prompt experience. - Improved Machine Context: Integrated
user@hostnameinto the prompt for clear session identification across multiple machines and SSH sessions. - Zsh-Enforced Development Shell: Updated the Nix development environment to automatically launch Zsh, ensuring immediate support for the transient prompt feature and a consistent setup.
You can easily use this theme in your NixOS configuration using Home Manager.
let
catppuccin-omp-src = pkgs.fetchFromGitHub {
owner = "SuperGamer1337";
repo = "catppuccin.omp";
rev = "main"; # Use a specific commit hash for reproducibility
sha256 = lib.fakeSha256; # Replace with the actual hash after the first build failure
};
in
{
programs.oh-my-posh = {
enable = true;
enableZshIntegration = true;
configFile = "${catppuccin-omp-src}/mocha.omp.json";
};
}Tip
When updating the repository, you can set sha256 = ""; or use lib.fakeSha256. The build will fail and provide you with the correct hash to paste back into your configuration.
Font used is JetBrainsMono Nerd Font
Ensure that Oh My Posh is installed and your terminal is configured with a Nerd font. For a seamless appearance, we recommend using the corresponding catppuccin flavor for your Terminal, which can be found in this list under 🌱 Terminals. Follow the instructions below based on your shell. The examples provided use the mocha flavor; adjust the --config value to match the flavor of your choice."
bash
Adjust the Oh My Posh init line in ~/.bashrc (could be ~/.profile or ~/.bash_profile depending on your environment) by adding the --config flag with the catppuccin flavor of your choice.
eval "$(oh-my-posh init bash --config 'https://raw.githubusercontent.com/maxstolly/catppuccin.omp/main/mocha.omp.json')"Once altered, reload your profile for the changes to take effect:
exec bashcmd
Adjust the Oh My Posh init line in oh-my-posh.lua by adding the --config flag with the catppuccin flavor of your choice.
load(io.popen('oh-my-posh init cmd --config "https://raw.githubusercontent.com/maxstolly/catppuccin.omp/main/mocha.omp.json"'):read("*a"))()Once altered, restart cmd for the changes to take effect.
elvish
Adjust the Oh My Posh init line in ~/.elvish/rc.elv by adding the --config flag with the catppuccin flavor of your choice.
eval (oh-my-posh init elvish --config 'https://raw.githubusercontent.com/maxstolly/catppuccin.omp/main/mocha.omp.json')Once added, reload your profile for the changes to take effect:
exec elvishfish
Adjust the Oh My Posh init line in ~/.config/fish/config.fish by adding the --config flag with the catppuccin flavor of your choice.
oh-my-posh init fish --config 'https://raw.githubusercontent.com/maxstolly/catppuccin.omp/main/mocha.omp.json' | sourceOnce altered, reload your config for the changes to take effect:
. ~/.config/fish/config.fishnushell
Adjust the Oh My Posh init line in Nushell env file ($nu.env-path) by adding the --config flag with the catppuccin flavor of your choice.
oh-my-posh init nu --config 'https://raw.githubusercontent.com/maxstolly/catppuccin.omp/main/mocha.omp.json'This saves the initialization script to ~/.oh-my-posh.nu. Now, edit the Nushell config file ($nu.config-path) and add the following line at the bottom:
source ~/.oh-my-posh.nuIf you want to save the initialization script elsewhere, you can change the first line to something like this:
oh-my-posh init nu --config 'https://raw.githubusercontent.com/maxstolly/catppuccin.omp/main/mocha.omp.json' --print | save /mylocation/myscript.nu --forceAnd change the source line to:
source /mylocation/myscript.nupowershell
Adjust the Oh My Posh init line in your $PROFILE by adding the --config flag with the catppuccin flavor of your choice.
oh-my-posh init pwsh --config 'https://raw.githubusercontent.com/maxstolly/catppuccin.omp/main/mocha.omp.json' | Invoke-ExpressionOnce altered, reload your profile for the changes to take effect:
. $PROFILEWhen the above command gives an error, make sure to create the profile first and add the oh-my-posh init above.
New-Item -Path $PROFILE -Type File -ForceIn this scenario, it can also be that PowerShell blocks running local scripts. To solve that, set PowerShell to only require remote scripts to be signed using Set-ExecutionPolicy RemoteSigned, or sign the profile.
tcsh
Adjust the Oh My Posh init line in ~/.tcshrc by adding the --config flag with the catppuccin flavor of your choice.
eval `oh-my-posh init tcsh --config 'https://raw.githubusercontent.com/maxstolly/catppuccin.omp/main/mocha.omp.json'`Once added, reload your profile for the changes to take effect:
exec tcshxonsh
Adjust the Oh My Posh init line in ~/.xonshrc by adding the --config flag with the catppuccin flavor of your choice.
execx($(oh-my-posh init xonsh --config 'https://raw.githubusercontent.com/maxstolly/catppuccin.omp/main/mocha.omp.json'))Once added, reload your profile for the changes to take effect:
exec xonshzsh
Adjust the Oh My Posh init line in ~/.zshrc by adding the --config flag with the catppuccin flavor of your choice.
eval "$(oh-my-posh init zsh --config 'https://raw.githubusercontent.com/maxstolly/catppuccin.omp/main/mocha.omp.json')"Once added, reload your profile for the changes to take effect:
exec zshTailor this theme to suit your preferences by either cloning the repository or using a command like oh-my-posh config export --output ~/mytheme.omp.json. If you encounter a bug or believe a certain feature should be incorporated, feel free to open an issue or submit a pull request. Consult the Oh My Posh documentation for guidance on configuring themes.
Copyright © 2021-present Catppuccin Org




