diff --git a/modules/home/caem/core/zsh/conf.d/ps1.zsh b/modules/home/caem/core/zsh/conf.d/ps1.zsh new file mode 100644 index 0000000..b1a56e6 --- /dev/null +++ b/modules/home/caem/core/zsh/conf.d/ps1.zsh @@ -0,0 +1,21 @@ +#!/usr/bin/env zsh +# TODO: Add vcs and nix shell indicator + +# stt colors +local c0=$'\e[0;0m' +local c31=$'\e[31;0m' +local c33=$'\e[33;0m' +local c34=$'\e[34;0m' +local c35=$'\e[35;0m' +local c38=$'\e[38;0m' +# end colors + +nix_shell_ps1_t=" $c34{$c33󱄅 shell$c34}$c0" +if [ -n "$IN_NIX_SHELL" ]; then + nix_shell_ps1="$nix_shell_ps1_t" +elif [[ "$PATH" == *"/nix/store"* ]]; then + IN_NIX_SHELL=true + nix_shell_ps1="$nix_shell_ps1_t" +fi + +export PS1="$c35[$c31%3~$nix_shell_ps1$c35]$c0# " diff --git a/modules/home/caem/core/zsh.nix b/modules/home/caem/core/zsh/default.nix similarity index 80% rename from modules/home/caem/core/zsh.nix rename to modules/home/caem/core/zsh/default.nix index 8b34103..11fe7be 100644 --- a/modules/home/caem/core/zsh.nix +++ b/modules/home/caem/core/zsh/default.nix @@ -10,6 +10,7 @@ tmux fastfetch tre-command + btop ]; programs.bat = { @@ -19,7 +20,18 @@ }; }; + programs.btop = { + enable = true; + settings = { + color_theme = "TTY"; + }; + }; + home.file.".zshenv".enable = false; + home.file.".config/zsh/conf.d" = { + source = ./conf.d; + recursive = true; + }; programs.zsh = { enable = true; enableCompletion = true; @@ -42,8 +54,11 @@ initExtra = '' alias -g -- -h='-h 2>&1 | bat --language=help --style=plain' alias -g -- --help='--help 2>&1 | bat --language=help --style=plain' - export MANPAGER="sh -c 'sed -u -e \"s/\\x1B\[[0-9;]*m//g; s/.\\x08//g\" | bat -p -lman'" + for dotfile in "$ZDOTDIR/conf.d/"*; do + source "$dotfile" + done + # TODO: Add vcs and nix shell indicator export PS1=$'\e[0;38m[\e[0;31m%3~\e[0;38m]\e[0;0m# ' '';