Tuning bash colors
This commit is contained in:
260
conf/dircolors/dracula.dircolors
Normal file
260
conf/dircolors/dracula.dircolors
Normal file
@@ -0,0 +1,260 @@
|
|||||||
|
# https://github.com/dracula/dircolors
|
||||||
|
|
||||||
|
# Configuration file for dircolors, a utility to help you set the
|
||||||
|
# LS_COLORS environment variable used by GNU ls with the --color option.
|
||||||
|
|
||||||
|
# Copyright (C) 1996-2024 Free Software Foundation, Inc.
|
||||||
|
# Copying and distribution of this file, with or without modification,
|
||||||
|
# are permitted provided the copyright notice and this notice are preserved.
|
||||||
|
|
||||||
|
#
|
||||||
|
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
|
||||||
|
# slackware version of dircolors) are recognized but ignored.
|
||||||
|
|
||||||
|
# Global config options can be specified before TERM or COLORTERM entries
|
||||||
|
|
||||||
|
# ===================================================================
|
||||||
|
# Terminal filters
|
||||||
|
# ===================================================================
|
||||||
|
# Below are TERM or COLORTERM entries, which can be glob patterns, which
|
||||||
|
# restrict following config to systems with matching environment variables.
|
||||||
|
COLORTERM ?*
|
||||||
|
TERM Eterm
|
||||||
|
TERM ansi
|
||||||
|
TERM *color*
|
||||||
|
TERM con[0-9]*x[0-9]*
|
||||||
|
TERM cons25
|
||||||
|
TERM console
|
||||||
|
TERM cygwin
|
||||||
|
TERM *direct*
|
||||||
|
TERM dtterm
|
||||||
|
TERM gnome
|
||||||
|
TERM hurd
|
||||||
|
TERM jfbterm
|
||||||
|
TERM konsole
|
||||||
|
TERM kterm
|
||||||
|
TERM linux
|
||||||
|
TERM linux-c
|
||||||
|
TERM mlterm
|
||||||
|
TERM putty
|
||||||
|
TERM rxvt*
|
||||||
|
TERM screen*
|
||||||
|
TERM st
|
||||||
|
TERM terminator
|
||||||
|
TERM tmux*
|
||||||
|
TERM vt48;2;98;114;164
|
||||||
|
TERM xterm*
|
||||||
|
|
||||||
|
# ===================================================================
|
||||||
|
# Basic file attributes
|
||||||
|
# ===================================================================
|
||||||
|
# Below are the color init strings for the basic file types.
|
||||||
|
# One can use codes for 256 or more colors supported by modern terminals.
|
||||||
|
# The default color codes use the capabilities of an 8 color terminal
|
||||||
|
# with some additional attributes as per the following codes:
|
||||||
|
# Attribute codes:
|
||||||
|
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
|
||||||
|
# Text color codes:
|
||||||
|
# 38;2;33;34;44=black 38;2;255;85;85=red 38;2;80;250;123=green 38;2;241;250;140=yellow 38;2;189;147;249=blue 38;2;255;121;198=magenta 38;2;139;233;253=cyan 38;2;248;248;242=white
|
||||||
|
# Background color codes:
|
||||||
|
# 48;2;33;34;44=black 48;2;255;85;85=red 48;2;80;250;123=green 48;2;241;250;140=yellow 48;2;189;147;249=blue 48;2;255;121;198=magenta 48;2;139;233;253=cyan 48;2;248;248;242=white
|
||||||
|
#NORMAL 00 # no color code at all
|
||||||
|
#FILE 00 # regular file: use no color at all
|
||||||
|
RESET 0 # reset to "normal" color
|
||||||
|
DIR 01;38;2;189;147;249 # directory
|
||||||
|
LINK 01;38;2;139;233;253 # symbolic link. (If you set this to 'target' instead of a
|
||||||
|
# numerical value, the color is as for the file pointed to.)
|
||||||
|
MULTIHARDLINK 00 # regular file with more than one link
|
||||||
|
FIFO 48;2;33;34;44;38;2;241;250;140 # pipe
|
||||||
|
SOCK 01;38;2;255;121;198 # socket
|
||||||
|
DOOR 01;38;2;255;121;198 # door
|
||||||
|
BLK 48;2;33;34;44;38;2;241;250;140;01 # block device driver
|
||||||
|
CHR 48;2;33;34;44;38;2;241;250;140;01 # character device driver
|
||||||
|
ORPHAN 48;2;33;34;44;38;2;255;85;85;01 # symlink to nonexistent file, or non-stat'able file ...
|
||||||
|
MISSING 00 # ... and the files they point to
|
||||||
|
SETUID 38;2;248;248;242;48;2;255;85;85 # file that is setuid (u+s)
|
||||||
|
SETGID 38;2;33;34;44;48;2;241;250;140 # file that is setgid (g+s)
|
||||||
|
CAPABILITY 00 # file with capability (very expensive to lookup)
|
||||||
|
STICKY_OTHER_WRITABLE 38;2;33;34;44;48;2;80;250;123 # dir that is sticky and other-writable (+t,o+w)
|
||||||
|
OTHER_WRITABLE 38;2;189;147;249;48;2;80;250;123 # dir that is other-writable (o+w) and not sticky
|
||||||
|
STICKY 38;2;248;248;242;48;2;189;147;249 # dir with the sticky bit set (+t) and not other-writable
|
||||||
|
|
||||||
|
# This is for files with execute permission:
|
||||||
|
EXEC 01;38;2;80;250;123
|
||||||
|
|
||||||
|
# ===================================================================
|
||||||
|
# File extension attributes
|
||||||
|
# ===================================================================
|
||||||
|
# List any file extensions like '.gz' or '.tar' that you would like ls
|
||||||
|
# to color below. Put the suffix, a space, and the color init string.
|
||||||
|
# (and any comments you want to add after a '#').
|
||||||
|
# Suffixes are matched case insensitively, but if you define different
|
||||||
|
# init strings for separate cases, those will be honored.
|
||||||
|
#
|
||||||
|
|
||||||
|
# If you use DOS-style suffixes, you may want to uncomment the following:
|
||||||
|
#.cmd 01;38;2;80;250;123 # executables (bright green)
|
||||||
|
#.exe 01;38;2;80;250;123
|
||||||
|
#.com 01;38;2;80;250;123
|
||||||
|
#.btm 01;38;2;80;250;123
|
||||||
|
#.bat 01;38;2;80;250;123
|
||||||
|
# Or if you want to color scripts even if they do not have the
|
||||||
|
# executable bit actually set.
|
||||||
|
#.sh 01;38;2;80;250;123
|
||||||
|
#.csh 01;38;2;80;250;123
|
||||||
|
|
||||||
|
# archives or compressed (bright red)
|
||||||
|
.7z 01;38;2;255;85;85
|
||||||
|
.ace 01;38;2;255;85;85
|
||||||
|
.alz 01;38;2;255;85;85
|
||||||
|
.apk 01;38;2;255;85;85
|
||||||
|
.arc 01;38;2;255;85;85
|
||||||
|
.arj 01;38;2;255;85;85
|
||||||
|
.bz 01;38;2;255;85;85
|
||||||
|
.bz2 01;38;2;255;85;85
|
||||||
|
.cab 01;38;2;255;85;85
|
||||||
|
.cpio 01;38;2;255;85;85
|
||||||
|
.crate 01;38;2;255;85;85
|
||||||
|
.deb 01;38;2;255;85;85
|
||||||
|
.drpm 01;38;2;255;85;85
|
||||||
|
.dwm 01;38;2;255;85;85
|
||||||
|
.dz 01;38;2;255;85;85
|
||||||
|
.ear 01;38;2;255;85;85
|
||||||
|
.egg 01;38;2;255;85;85
|
||||||
|
.esd 01;38;2;255;85;85
|
||||||
|
.gz 01;38;2;255;85;85
|
||||||
|
.jar 01;38;2;255;85;85
|
||||||
|
.lha 01;38;2;255;85;85
|
||||||
|
.lrz 01;38;2;255;85;85
|
||||||
|
.lz 01;38;2;255;85;85
|
||||||
|
.lz4 01;38;2;255;85;85
|
||||||
|
.lzh 01;38;2;255;85;85
|
||||||
|
.lzma 01;38;2;255;85;85
|
||||||
|
.lzo 01;38;2;255;85;85
|
||||||
|
.pyz 01;38;2;255;85;85
|
||||||
|
.rar 01;38;2;255;85;85
|
||||||
|
.rpm 01;38;2;255;85;85
|
||||||
|
.rz 01;38;2;255;85;85
|
||||||
|
.sar 01;38;2;255;85;85
|
||||||
|
.swm 01;38;2;255;85;85
|
||||||
|
.t7z 01;38;2;255;85;85
|
||||||
|
.tar 01;38;2;255;85;85
|
||||||
|
.taz 01;38;2;255;85;85
|
||||||
|
.tbz 01;38;2;255;85;85
|
||||||
|
.tbz2 01;38;2;255;85;85
|
||||||
|
.tgz 01;38;2;255;85;85
|
||||||
|
.tlz 01;38;2;255;85;85
|
||||||
|
.txz 01;38;2;255;85;85
|
||||||
|
.tz 01;38;2;255;85;85
|
||||||
|
.tzo 01;38;2;255;85;85
|
||||||
|
.tzst 01;38;2;255;85;85
|
||||||
|
.udeb 01;38;2;255;85;85
|
||||||
|
.war 01;38;2;255;85;85
|
||||||
|
.whl 01;38;2;255;85;85
|
||||||
|
.wim 01;38;2;255;85;85
|
||||||
|
.xz 01;38;2;255;85;85
|
||||||
|
.z 01;38;2;255;85;85
|
||||||
|
.zip 01;38;2;255;85;85
|
||||||
|
.zoo 01;38;2;255;85;85
|
||||||
|
.zst 01;38;2;255;85;85
|
||||||
|
|
||||||
|
# image formats
|
||||||
|
.avif 01;38;2;255;121;198
|
||||||
|
.jpg 01;38;2;255;121;198
|
||||||
|
.jpeg 01;38;2;255;121;198
|
||||||
|
.mjpg 01;38;2;255;121;198
|
||||||
|
.mjpeg 01;38;2;255;121;198
|
||||||
|
.gif 01;38;2;255;121;198
|
||||||
|
.bmp 01;38;2;255;121;198
|
||||||
|
.pbm 01;38;2;255;121;198
|
||||||
|
.pgm 01;38;2;255;121;198
|
||||||
|
.ppm 01;38;2;255;121;198
|
||||||
|
.tga 01;38;2;255;121;198
|
||||||
|
.xbm 01;38;2;255;121;198
|
||||||
|
.xpm 01;38;2;255;121;198
|
||||||
|
.tif 01;38;2;255;121;198
|
||||||
|
.tiff 01;38;2;255;121;198
|
||||||
|
.png 01;38;2;255;121;198
|
||||||
|
.svg 01;38;2;255;121;198
|
||||||
|
.svgz 01;38;2;255;121;198
|
||||||
|
.mng 01;38;2;255;121;198
|
||||||
|
.pcx 01;38;2;255;121;198
|
||||||
|
.mov 01;38;2;255;121;198
|
||||||
|
.mpg 01;38;2;255;121;198
|
||||||
|
.mpeg 01;38;2;255;121;198
|
||||||
|
.m2v 01;38;2;255;121;198
|
||||||
|
.mkv 01;38;2;255;121;198
|
||||||
|
.webm 01;38;2;255;121;198
|
||||||
|
.webp 01;38;2;255;121;198
|
||||||
|
.ogm 01;38;2;255;121;198
|
||||||
|
.mp4 01;38;2;255;121;198
|
||||||
|
.m4v 01;38;2;255;121;198
|
||||||
|
.mp4v 01;38;2;255;121;198
|
||||||
|
.vob 01;38;2;255;121;198
|
||||||
|
.qt 01;38;2;255;121;198
|
||||||
|
.nuv 01;38;2;255;121;198
|
||||||
|
.wmv 01;38;2;255;121;198
|
||||||
|
.asf 01;38;2;255;121;198
|
||||||
|
.rm 01;38;2;255;121;198
|
||||||
|
.rmvb 01;38;2;255;121;198
|
||||||
|
.flc 01;38;2;255;121;198
|
||||||
|
.avi 01;38;2;255;121;198
|
||||||
|
.fli 01;38;2;255;121;198
|
||||||
|
.flv 01;38;2;255;121;198
|
||||||
|
.gl 01;38;2;255;121;198
|
||||||
|
.dl 01;38;2;255;121;198
|
||||||
|
.xcf 01;38;2;255;121;198
|
||||||
|
.xwd 01;38;2;255;121;198
|
||||||
|
.yuv 01;38;2;255;121;198
|
||||||
|
.cgm 01;38;2;255;121;198
|
||||||
|
.emf 01;38;2;255;121;198
|
||||||
|
|
||||||
|
# https://wiki.xiph.org/MIME_Types_and_File_Extensions
|
||||||
|
.ogv 01;38;2;255;121;198
|
||||||
|
.ogx 01;38;2;255;121;198
|
||||||
|
|
||||||
|
# audio formats
|
||||||
|
.aac 00;38;2;139;233;253
|
||||||
|
.au 00;38;2;139;233;253
|
||||||
|
.flac 00;38;2;139;233;253
|
||||||
|
.m4a 00;38;2;139;233;253
|
||||||
|
.mid 00;38;2;139;233;253
|
||||||
|
.midi 00;38;2;139;233;253
|
||||||
|
.mka 00;38;2;139;233;253
|
||||||
|
.mp3 00;38;2;139;233;253
|
||||||
|
.mpc 00;38;2;139;233;253
|
||||||
|
.ogg 00;38;2;139;233;253
|
||||||
|
.ra 00;38;2;139;233;253
|
||||||
|
.wav 00;38;2;139;233;253
|
||||||
|
|
||||||
|
# https://wiki.xiph.org/MIME_Types_and_File_Extensions
|
||||||
|
.oga 00;38;2;139;233;253
|
||||||
|
.opus 00;38;2;139;233;253
|
||||||
|
.spx 00;38;2;139;233;253
|
||||||
|
.xspf 00;38;2;139;233;253
|
||||||
|
|
||||||
|
# backup files
|
||||||
|
*~ 00;38;2;98;114;164
|
||||||
|
*# 00;38;2;98;114;164
|
||||||
|
.bak 00;38;2;98;114;164
|
||||||
|
.crdownload 00;38;2;98;114;164
|
||||||
|
.dpkg-dist 00;38;2;98;114;164
|
||||||
|
.dpkg-new 00;38;2;98;114;164
|
||||||
|
.dpkg-old 00;38;2;98;114;164
|
||||||
|
.dpkg-tmp 00;38;2;98;114;164
|
||||||
|
.old 00;38;2;98;114;164
|
||||||
|
.orig 00;38;2;98;114;164
|
||||||
|
.part 00;38;2;98;114;164
|
||||||
|
.rej 00;38;2;98;114;164
|
||||||
|
.rpmnew 00;38;2;98;114;164
|
||||||
|
.rpmorig 00;38;2;98;114;164
|
||||||
|
.rpmsave 00;38;2;98;114;164
|
||||||
|
.swp 00;38;2;98;114;164
|
||||||
|
.tmp 00;38;2;98;114;164
|
||||||
|
.ucf-dist 00;38;2;98;114;164
|
||||||
|
.ucf-new 00;38;2;98;114;164
|
||||||
|
.ucf-old 00;38;2;98;114;164
|
||||||
|
|
||||||
|
#
|
||||||
|
# Subsequent TERM or COLORTERM entries, can be used to add / override
|
||||||
|
# config specific to those matching environment variables.
|
||||||
@@ -1,24 +1,20 @@
|
|||||||
#!/usr/bin/env bash
|
# Inspired by
|
||||||
|
# https://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/
|
||||||
|
# https://linux.101hacks.com/ps1-examples/prompt-color-using-tput/
|
||||||
|
|
||||||
function get_color()
|
RED=$(tput setaf 1)
|
||||||
{
|
GREEN=$(tput setaf 2)
|
||||||
local color="$1"
|
CYAN=$(tput setaf 6)
|
||||||
echo "\[$(tput setaf "$color")\]"
|
COLOR_RESET=$(tput sgr0)
|
||||||
}
|
|
||||||
|
|
||||||
readonly RED=$(get_color 1)
|
|
||||||
readonly GREEN=$(get_color 2)
|
|
||||||
readonly CYAN=$(get_color 6)
|
|
||||||
readonly END_COLOR='\[\033[00m\]'
|
|
||||||
|
|
||||||
function get_ps1_prompt()
|
function get_ps1_prompt()
|
||||||
{
|
{
|
||||||
local username='\u'
|
local username='\u'
|
||||||
local hostname='\h'
|
local hostname='\h'
|
||||||
local working_directory='\w'
|
local workdir='\w'
|
||||||
local user_type='\$'
|
local user_type='\$'
|
||||||
|
|
||||||
echo "${debian_chroot:+($debian_chroot)}${GREEN}${username}@${hostname}${END_COLOR}:${CYAN}${working_directory}${END_COLOR}${user_type} "
|
echo "${debian_chroot:+($debian_chroot)}${GREEN}${username}@${hostname}${COLOR_RESET}:${CYAN}${workdir}${COLOR_RESET}${user_type} "
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_ps1_prompt()
|
function set_ps1_prompt()
|
||||||
|
|||||||
@@ -2,11 +2,14 @@
|
|||||||
# https://dev.to/fernand0/better-colors-for-ls-in-dark-terminals-3d6
|
# https://dev.to/fernand0/better-colors-for-ls-in-dark-terminals-3d6
|
||||||
# https://github.com/seebi/dircolors-solarized
|
# https://github.com/seebi/dircolors-solarized
|
||||||
|
|
||||||
COLORS_FILE="$LWS/conf/dircolors.ansi-light"
|
#COLORS_FILE="$LWS/conf/dircolors/ansi-light.dircolors"
|
||||||
|
COLORS_FILE="$LWS/conf/dircolors/dracula.dircolors"
|
||||||
|
|
||||||
if [[ -f "$COLORS_FILE" ]]; then
|
if [[ -f "$COLORS_FILE" ]]; then
|
||||||
xlog "Loading colors $COLORS_FILE"
|
xlog "Loading colors $COLORS_FILE"
|
||||||
eval "$(dircolors "$COLORS_FILE")"
|
eval "$(dircolors "$COLORS_FILE")"
|
||||||
|
else
|
||||||
|
xlog "Colors $COLORS_FILE not found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset COLORS_FILE
|
unset COLORS_FILE
|
||||||
|
|||||||
Reference in New Issue
Block a user