diff --git a/ep.c b/ep.c index 6448a4e..71bb580 100644 --- a/ep.c +++ b/ep.c @@ -15,6 +15,7 @@ #include #include +#include "colors.h" #include "info_strings.h" #include "ep.h" @@ -81,7 +82,7 @@ int main(int argc, char **argv) /* show we are on a different machine */ print_ssh(); - print_pwd(home, pwd); + use_color(bcyan, print_pwd(home, pwd)); /* git status */ void *git_info; @@ -117,7 +118,7 @@ int main(int argc, char **argv) if (n > 1) { /* jobs emoji is wide */ p(" "); - p(shell_jobs); + use_color(blue, p(shell_jobs)); } } } @@ -140,13 +141,13 @@ int main(int argc, char **argv) } else { snprintf(dur, sizeof(dur), " %llds", command_duration); } - p(dur); + use_color(green, p(dur)); } /* 127 means command not found, that prints a big enough message already */ if (exit_status && exit_status != 127) { char ex[256]; snprintf(ex, sizeof(ex), " [%d]", exit_status); - p(ex); + use_color(green, p(ex)); } p(PROMPT); diff --git a/git.c b/git.c index 7bc118e..becb87d 100644 --- a/git.c +++ b/git.c @@ -5,6 +5,7 @@ #include #include +#include "colors.h" #include "ep.h" struct git_info { @@ -17,13 +18,15 @@ void print_git(void *arg) if (git_info->git_branch_name) { p(" "); - p(git_info->git_branch_name); + use_color(magenta, p(git_info->git_branch_name)); + fg_color(blue); if (git_info->git_status) { p(" ["); p(git_info->git_status); p("]"); } + reset_color(); } } diff --git a/lang.c b/lang.c index 8a8a268..25c3371 100644 --- a/lang.c +++ b/lang.c @@ -4,6 +4,7 @@ #include #include +#include "colors.h" #include "ep.h" enum lang_index { @@ -49,11 +50,14 @@ const struct lang_check l[] = { /* bitmap of 1< #include +#include "colors.h" #include "ep.h" void print_ssh(void) @@ -16,8 +17,10 @@ void print_ssh(void) if (uname(&u) || !u.nodename[0]) return; + fg_color(yellow); p("("); p(u.nodename); p(") "); + reset_color(); } }