dotfiles

$HOME is where the <3 is
git clone git://git.alexkarle.com/dotfiles.git
Log | Files | Refs | Submodules | README

commit 41c2bf905b17f6ae5fddd46f09613df19a01671e (patch)
parent 43aa8a11f1ffc328d7ce994359f9a85e8cc3ca67
Author: Alex Karle <alex@karle.co>
Date:   Tue, 30 Jul 2019 23:55:44 -0400

bash: add Virtual Console Gruvbox-like 16color theme

There's something nice about the Virtual Console. No mouse, no
distractions, no popups... it's pure concentration, and I'm slowly
getting comfortably set up there.

Getting a decent colorscheme set up took a *while* (see previous long
commit about $TERM and NeoVim). But having a 16-color gruvbox inspired
theme to the console is remarkably easy.

Note that bolding the first 8 colors results in the "bright" versions,
which allows the bash_prompt to still use real tput colors (past 8
doesn't exist in TERM=linux) but get the bright colors too.

Diffstat:
Mbash/bashrc | 1+
Abash/console_theme | 25+++++++++++++++++++++++++
2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/bash/bashrc b/bash/bashrc @@ -48,5 +48,6 @@ function source_if_exists { source_if_exists "$HOME/.bash/git-completion.bash" # Git Completion source_if_exists "$HOME/.aliases" # Aliases (source after Git Completion!) +source_if_exists "$HOME/.console_theme" # Virtual Console colors (if TERM == "linux") source_if_exists "$HOME/.bash_prompt" # Personal Prompt source_if_exists "$HOME/.bashrc.local" # System specific settings diff --git a/bash/console_theme b/bash/console_theme @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# bash/console_theme +# A small script to set the Virtual Console to use Gruvbox colors. +# Colors originally from https://github.com/morhetz/gruvbox by Pavel Pertsev +# For more on escape sequences see console_codes(4) +if [[ "$TERM" =~ "linux" ]]; then + # Gruvbox 16 colors + printf "\033]P0282828" # 0: Black + printf "\033]P1cc241d" # 1: Red + printf "\033]P298971a" # 2: Green + printf "\033]P3d79921" # 3: Yellow + printf "\033]P4458588" # 4: Blue + printf "\033]P5b16286" # 5: Magenta + printf "\033]P6689d6a" # 6: Cyan + printf "\033]P7a89984" # 7: White + printf "\033]P8928374" # 8: Bright Black + printf "\033]P9fb4934" # 9: Bright Red + printf "\033]Pab8bb26" # 10: Bright Green + printf "\033]Pbfabd2f" # 11: Bright Yellow + printf "\033]Pc83a598" # 12: Bright Blue + printf "\033]Pdd3869b" # 13: Bright Magenta + printf "\033]Pe8ec07c" # 14: Bright Cyan + printf "\033]Pfebdbb2" # 15: Bright White + clear # Redraw the screen... +fi