diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-17 20:40:43 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-17 20:40:43 +1300 |
commit | be21a07eeaa6b0bcef8bcffb91889ddf4f338040 (patch) | |
tree | 163d3fb5082ae0ea6f2728e1b9f150fde6e7c201 | |
parent | Merge branch 'master' into freebsd (diff) | |
parent | Color Zsh prompt distinctively (diff) | |
download | dotfiles-be21a07eeaa6b0bcef8bcffb91889ddf4f338040.tar.gz dotfiles-be21a07eeaa6b0bcef8bcffb91889ddf4f338040.zip |
Merge branch 'master' into freebsd
-rw-r--r-- | ISSUES.markdown | 10 | ||||
-rw-r--r-- | Makefile | 26 | ||||
-rw-r--r-- | README.markdown | 17 | ||||
-rw-r--r-- | X/xinitrc | 37 | ||||
-rw-r--r-- | X/xinitrc.d/browser.sh | 4 | ||||
-rw-r--r-- | X/xinitrc.d/dunst.sh | 3 | ||||
-rw-r--r-- | X/xinitrc.d/mpdlrc.sh | 3 | ||||
-rw-r--r-- | X/xinitrc.d/redshift.sh | 3 | ||||
-rw-r--r-- | X/xinitrc.d/ssh.sh | 4 | ||||
-rw-r--r-- | X/xinitrc.d/urxvt.sh | 3 | ||||
-rw-r--r-- | X/xinitrc.d/xbackground.sh | 3 | ||||
-rw-r--r-- | X/xinitrc.d/xbindkeys.sh | 3 | ||||
-rw-r--r-- | X/xinitrc.d/xkb.sh | 5 | ||||
-rwxr-xr-x | bin/cf | 32 | ||||
-rwxr-xr-x | bin/cfr | 34 | ||||
-rwxr-xr-x | bin/xrbg | 4 | ||||
-rwxr-xr-x | check/ksh | 6 | ||||
-rwxr-xr-x | check/pdksh | 6 | ||||
-rw-r--r-- | ksh/kshrc | 17 | ||||
-rw-r--r-- | ksh/kshrc.d/prompt.ksh (renamed from pdksh/pdkshrc.d/prompt.pdksh) | 30 | ||||
-rwxr-xr-x | lint/ksh | 2 | ||||
-rwxr-xr-x | lint/pdksh | 2 | ||||
-rw-r--r-- | man/man1/rnds.1df | 1 | ||||
-rw-r--r-- | man/man1/xrbg.1df | 19 | ||||
-rw-r--r-- | pdksh/pdkshrc | 13 | ||||
-rw-r--r-- | sh/shrc.d/ksh.sh | 10 | ||||
-rw-r--r-- | vim/after/ftdetect/sh.vim | 2 | ||||
-rw-r--r-- | zsh/zshrc.d/prompt.zsh | 2 |
28 files changed, 136 insertions, 165 deletions
diff --git a/ISSUES.markdown b/ISSUES.markdown index 6808fab3..19375c83 100644 --- a/ISSUES.markdown +++ b/ISSUES.markdown @@ -15,12 +15,6 @@ Known issues * A key binding for importing sections of the screen and optionally uploading it would be great, probably using ImageMagick import(1) * sxhkd(1) might be nicer than xbindkeys; it's in Debian Testing now -* xrbg(1) is likely redundant: - - 13:31:51 <tejr> i pick a random one on startup with a little script - 13:32:41 <cosarara> I run this on startup http://sprunge.us/JFCL - 13:33:06 <tejr> haha i didn't even know about --randomize - 13:33:14 <tejr> p sure that makes my script redundant actually - 13:33:32 <tejr> yep it does - * dr(1df) is probably more practical in awk +* How come commands I fix with the fc builtin always seem to exit 1 even if + they succeed? Did I do that or is it Bash? @@ -23,7 +23,7 @@ install-ncmcpp \ install-newsbeuter \ install-mysql \ - install-pdksh \ + install-ksh \ install-perlcritic \ install-perltidy \ install-psql \ @@ -46,7 +46,7 @@ check-bash \ check-bin \ check-games \ - check-pdksh \ + check-ksh \ check-sh \ check-urxvt \ check-yash \ @@ -54,7 +54,7 @@ lint-bash \ lint-bin \ lint-games \ - lint-pdksh \ + lint-ksh \ lint-yash \ lint-sh \ lint-urxvt @@ -290,11 +290,11 @@ install-newsbeuter : install-mysql : install -pm 0644 -- mysql/my.cnf "$(HOME)"/.my.cnf -install-pdksh : check-pdksh install-sh +install-ksh : check-ksh install-sh install -m 0755 -d -- \ - "$(HOME)"/.pdkshrc.d - install -pm 0644 -- pdksh/pdkshrc "$(HOME)"/.pdkshrc - install -pm 0644 -- pdksh/pdkshrc.d/* "$(HOME)"/.pdkshrc.d + "$(HOME)"/.kshrc.d + install -pm 0644 -- ksh/kshrc "$(HOME)"/.kshrc + install -pm 0644 -- ksh/kshrc.d/* "$(HOME)"/.kshrc.d install-perlcritic : install -pm 0644 -- perlcritic/perlcriticrc "$(HOME)"/.perlcriticrc @@ -371,10 +371,12 @@ install-wyrd : install-x : install -m 0755 -d -- \ "$(HOME)"/.config \ + "$(HOME)"/.xinitrc.d \ "$(HOME)"/.Xresources.d install -pm 0644 -- X/redshift.conf "$(HOME)"/.config/redshift.conf install -pm 0644 -- X/xbindkeysrc "$(HOME)"/.xbindkeysrc install -pm 0644 -- X/xinitrc "$(HOME)"/.xinitrc + install -pm 0644 -- X/xinitrc.d/* "$(HOME)"/.xinitrc.d install -pm 0644 -- X/Xresources "$(HOME)"/.Xresources install -pm 0644 -- X/Xresources.d/* "$(HOME)"/.Xresources.d @@ -407,8 +409,8 @@ check-games : check-man : check/man -check-pdksh : - check/pdksh +check-ksh : + check/ksh check-sh : check/sh @@ -423,7 +425,7 @@ lint : check \ lint-bash \ lint-bin \ lint-games \ - lint-pdksh \ + lint-ksh \ lint-sh \ lint-urxvt \ lint-yash @@ -437,8 +439,8 @@ lint-bin : lint-games : lint/games -lint-pdksh : - lint/pdksh +lint-ksh : + lint/ksh lint-sh : lint/sh diff --git a/README.markdown b/README.markdown index f4c73817..5c9dc392 100644 --- a/README.markdown +++ b/README.markdown @@ -53,13 +53,12 @@ Configuration is included for: * [GTK+](http://www.gtk.org/) -- GIMP Toolkit, for graphical user interface elements * [i3](https://i3wm.org/) -- Tiling window manager +* [Korn shell](http://www.kornshell.com/) -- Korn shell and its derivatives * [less](https://www.gnu.org/software/less/) -- Terminal pager * [Mutt](http://www.mutt.org/) -- Terminal mail user agent * [`mysql(1)`](http://linux.die.net/man/1/mysql) -- Command-line MySQL client * [Ncmpcpp](https://rybczak.net/ncmpcpp/) -- ncurses music player client * [Newsbeuter](https://www.newsbeuter.org/) -- Terminal RSS/Atom feed reader -* [`pdksh(1)`](http://www.cs.mun.ca/~michael/pdksh/) -- public domain fork - of the Korn shell * [`psql(1)`](http://linux.die.net/man/1/psql) -- Command-line PostgreSQL client * [Perl::Critic](http://perlcritic.com/) -- static source code analysis @@ -254,12 +253,14 @@ I also add completions for my own scripts and functions where useful. The completions are dynamically loaded if Bash is version 4.0 or greater. Otherwise, they're all loaded on startup. -#### pdksh +#### Korn shell -The pdksh configuration files and functions are not nearly as featureful as the -Bash ones. They're tested on OpenBSD and FreeBSD pdksh implementations, but the -former is the primary system for which I'm maintaining them, and there are some -feature differences. +The `ksh` configuration files and functions are not nearly as featureful as the +Bash ones. At the moment these are mainly being maintained for use on OpenBSD +`pdksh`. + +`ksh`, `ksh93`, `pdksh`, and `mksh` shells default to having a prompt coloured +yellow. #### Yash @@ -270,6 +271,8 @@ Just enough configuration to coax it into reading `~/.profile` and `~/.shrc`. These are experimental; I do not like Zsh much at the moment. The files started as a joke (`exec bash`). +`zsh` shells default to having a prompt coloured cyan. + ### GnuPG The configuration for GnuPG is intended to follow [RiseUp's OpenPGP best @@ -1,41 +1,14 @@ -# Browser within X is Firefox -BROWSER=firefox -export BROWSER - -# Set SSH_ASKPASS if we can find one -if command -v ssh-askpass >/dev/null 2>&1 ; then - SSH_ASKPASS=$(command -v ssh-askpass) - export SSH_ASKPASS -fi - # Read X resources xrdb "$HOME"/.Xresources # Faster mouse acceleration with a natural threshold xset m 5/2 0 -# Start dunst(1) to display libnotify messages -dunst & - -# Start mpdlrc-notify-send <https://sanctum.geek.nz/cgit/mpdlrc.git/about/> -mpdlrc-notify-send & - -# Start redshift(1) -redshift & - -# Map Caps Lock as a Ctrl key, use right alt as Compose, kill X server with -# Ctrl+Alt+Backspace -# <https://en.wikipedia.org/wiki/Compose_key#Common_compose_combinations> -setxkbmap -option compose:ralt,ctrl:nocaps,terminate:ctrl_alt_bksp - -# Start urxvtd(1) -urxvtd -o -q & - -# Start xbindkeys(1) -xbindkeys -n & - -# Apply a random background image -xrbg +# Load all supplementary scripts in ~/.xinitrc.d +for sh in "$HOME"/.xinitrc.d/*.sh ; do + [ -e "$sh" ] && . "$sh" +done +unset -v sh # Start window manager exec i3 diff --git a/X/xinitrc.d/browser.sh b/X/xinitrc.d/browser.sh new file mode 100644 index 00000000..cdb9b8c0 --- /dev/null +++ b/X/xinitrc.d/browser.sh @@ -0,0 +1,4 @@ +# Browser within X is Firefox +command -v firefox >/dev/null 2>&1 || return +BROWSER=firefox +export BROWSER diff --git a/X/xinitrc.d/dunst.sh b/X/xinitrc.d/dunst.sh new file mode 100644 index 00000000..bddaa1fe --- /dev/null +++ b/X/xinitrc.d/dunst.sh @@ -0,0 +1,3 @@ +# Start dunst(1) to display libnotify messages +command -v dunst >/dev/null 2>&1 || return +dunst & diff --git a/X/xinitrc.d/mpdlrc.sh b/X/xinitrc.d/mpdlrc.sh new file mode 100644 index 00000000..98f2d92a --- /dev/null +++ b/X/xinitrc.d/mpdlrc.sh @@ -0,0 +1,3 @@ +# Start mpdlrc-notify-send <https://sanctum.geek.nz/cgit/mpdlrc.git/about/> +command -v mpdlrc-notify-send >/dev/null 2>&1 || return +mpdlrc-notify-send & diff --git a/X/xinitrc.d/redshift.sh b/X/xinitrc.d/redshift.sh new file mode 100644 index 00000000..d5d58d8a --- /dev/null +++ b/X/xinitrc.d/redshift.sh @@ -0,0 +1,3 @@ +# Start redshift(1) +command -v redshift >/dev/null 2>&1 || return +redshift & diff --git a/X/xinitrc.d/ssh.sh b/X/xinitrc.d/ssh.sh new file mode 100644 index 00000000..005743fe --- /dev/null +++ b/X/xinitrc.d/ssh.sh @@ -0,0 +1,4 @@ +# Set SSH_ASKPASS if we can find one +command -v ssh-askpass >/dev/null 2>&1 || return +SSH_ASKPASS=$(command -v ssh-askpass) +export SSH_ASKPASS diff --git a/X/xinitrc.d/urxvt.sh b/X/xinitrc.d/urxvt.sh new file mode 100644 index 00000000..a5eb0940 --- /dev/null +++ b/X/xinitrc.d/urxvt.sh @@ -0,0 +1,3 @@ +# Start urxvtd(1) +command -v urxvtd >/dev/null 2>&1 || return +urxvtd -o -q & diff --git a/X/xinitrc.d/xbackground.sh b/X/xinitrc.d/xbackground.sh new file mode 100644 index 00000000..7f2bc8c3 --- /dev/null +++ b/X/xinitrc.d/xbackground.sh @@ -0,0 +1,3 @@ +# Apply a random background image +command -v feh >/dev/null 2>&1 || return +feh --bg-scale --no-fehbg --randomize -- "${XBACKGROUNDS:-"$HOME"/.xbackgrounds}" diff --git a/X/xinitrc.d/xbindkeys.sh b/X/xinitrc.d/xbindkeys.sh new file mode 100644 index 00000000..a21bd995 --- /dev/null +++ b/X/xinitrc.d/xbindkeys.sh @@ -0,0 +1,3 @@ +# Start xbindkeys(1) +command -v xbindkeys >/dev/null 2>&1 || return +xbindkeys -n & diff --git a/X/xinitrc.d/xkb.sh b/X/xinitrc.d/xkb.sh new file mode 100644 index 00000000..a5142398 --- /dev/null +++ b/X/xinitrc.d/xkb.sh @@ -0,0 +1,5 @@ +# Map Caps Lock as a Ctrl key, use right alt as Compose, kill X server with +# Ctrl+Alt+Backspace +# <https://en.wikipedia.org/wiki/Compose_key#Common_compose_combinations> +command -v setxkbmap >/dev/null 2>&1 || return +setxkbmap -option compose:ralt,ctrl:nocaps,terminate:ctrl_alt_bksp @@ -5,32 +5,20 @@ # directory if none given for dir in "${@:-.}" ; do - # Strip a trailing slash - dir=${dir%/} + # Attempt to count the files in a subshell + if count=$( + cd -- "$dir" || exit + find . ! -name . -prune -exec printf %.sx {} + | + wc -c + ) ; then - # If the path is not absolute or already pre-dotted, tack a ./ to - # the front so that find(1) doesn't choke; otherwise juse use it - # as-is - case $dir in - /*|./*) fdir=$dir ;; - *) fdir=./$dir ;; - esac + # If it worked, print the count + printf '%u\t%s\n' "$count" "$dir" + else - # Warn if a non-directory was given, flag errors, but continue - if ! [ -d "$dir" ] ; then - printf >&2 'cf: %s: not a directory\n' "$dir" + # If not, set the error flag and continue ex=1 - continue fi - - # Count the files - count=$( - find "$fdir" -path "$fdir"'/*' -prune -exec printf %.sx {} + | - wc -c - ) - - # Print the count and the dirname - printf '%u\t%s\n' "$count" "$dir" done # Exit non-zero if a non-directory was given as an argument @@ -1,36 +1,24 @@ #!/bin/sh -# Count all descendants of given directories; don't follow symlinks +# Count entries in a given set of directories # Iterate over remaining non-option arguments (directories); default to current # directory if none given for dir in "${@:-.}" ; do - # Strip a trailing slash - dir=${dir%/} + # Attempt to count the files in a subshell + if count=$( + cd -- "$dir" || exit + find . ! -name . -exec printf %.sx {} + | + wc -c + ) ; then - # If the path is not absolute or already pre-dotted, tack a ./ to - # the front so that find(1) doesn't choke; otherwise juse use it - # as-is - case $dir in - /*|./*) fdir=$dir ;; - *) fdir=./$dir ;; - esac + # If it worked, print the count + printf '%u\t%s\n' "$count" "$dir" + else - # Warn if a non-directory was given, flag errors, but continue - if ! [ -d "$dir" ] ; then - printf >&2 'cfr: %s: Not a directory\n' "$dir" + # If not, set the error flag and continue ex=1 - continue fi - - # Count the files recursively - count=$( - find "$fdir" -path "$fdir"'/*' -exec printf %.sx {} + | - wc -c - ) - - # Print the count and the dirname - printf '%u\t%s\n' "$count" "$dir" done # Exit non-zero if a non-directory was given as an argument diff --git a/bin/xrbg b/bin/xrbg deleted file mode 100755 index 801bf078..00000000 --- a/bin/xrbg +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# Apply a random background image. Requires rndf(1df) and feh(1). -bg=$(rndf "${XBACKGROUNDS:-"$HOME"/.xbackgrounds}") || exit -feh --bg-scale --no-fehbg -- "$bg" diff --git a/check/ksh b/check/ksh new file mode 100755 index 00000000..3136c413 --- /dev/null +++ b/check/ksh @@ -0,0 +1,6 @@ +#!/bin/sh +for ksh in ksh/* ksh/kshrc.d/* ; do + [ -f "$ksh" ] || continue + ksh -n "$ksh" || exit +done +printf 'All ksh scripts parsed successfully.\n' diff --git a/check/pdksh b/check/pdksh deleted file mode 100755 index fd1d55b7..00000000 --- a/check/pdksh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -for pdksh in pdksh/* pdksh/pdkshrc.d/* ; do - [ -f "$pdksh" ] || continue - ksh -n "$pdksh" || exit -done -printf 'All pdksh scripts parsed successfully.\n' diff --git a/ksh/kshrc b/ksh/kshrc new file mode 100644 index 00000000..c45d4018 --- /dev/null +++ b/ksh/kshrc @@ -0,0 +1,17 @@ +# Emacs-style key bindings +set -o braceexpand +set -o emacs + +# Save history +HISTFILE=$HOME/.ksh_history +HISTSIZE=$((1 << 10)) + +# If HOST and HOSTNAME aren't set by this version of ksh, set them +HOSTNAME=$(uname -n) +HOST=${HOSTNAME%%.*} + +# Load any supplementary scripts +for kshrc in "$HOME"/.kshrc.d/*.ksh ; do + [[ -e $kshrc ]] && . "$kshrc" +done +unset -v kshrc diff --git a/pdksh/pdkshrc.d/prompt.pdksh b/ksh/kshrc.d/prompt.ksh index 63e965f9..f0aaadd3 100644 --- a/pdksh/pdkshrc.d/prompt.pdksh +++ b/ksh/kshrc.d/prompt.ksh @@ -1,6 +1,3 @@ -# All of this is only known to work on OpenBSD's fork of pdksh -[[ $(uname -s) == OpenBSD ]] || return - # Frontend to controlling prompt prompt() { @@ -18,12 +15,19 @@ prompt() { # Basic prompt shape depends on whether we're in SSH or not PS1= if [[ -n $SSH_CLIENT ]] || [[ -n $SSH_CONNECTION ]] ; then - PS1=$PS1'\u@\h:' + PS1=$PS1'$USER@$HOST:' fi - PS1=$PS1'\w' - # Add sub-commands; VCS, job, and return status checks - PS1=$PS1'$(prompt vcs)$(prompt job)$(prompt ret "$?")' + # Add sub-commands; working directory with ~ abbreviation, VCS, + # job, and return status checks + PS1=$PS1'$(prompt pwd)$(prompt vcs)$(prompt job)' + + # If this is PDKSH, add the exit code of the previous command; this + # doesn't seem to work on ksh93, probably different timing for when + # $? is set + case $KSH_VERSION in + *'PD KSH'*) PS1=$PS1'$(prompt ret "$?")' + esac # Add prefix and suffix PS1='${PROMPT_PREFIX}'$PS1'${PROMPT_SUFFIX}' @@ -70,7 +74,7 @@ prompt() { } >/dev/null 2>&1 # String it all together - PS1='\['"$format"'\]'"$PS1"'\['"$reset"'\] ' + PS1="${format}${PS1}${reset}"' ' PS2='> ' PS3='? ' PS4='+<$?> $LINENO:' @@ -159,6 +163,14 @@ prompt() { PS4='+ ' ;; + # Abbreviated working directory + pwd) + case $PWD in + "$HOME"|"$HOME"/*) printf ~%s "${PWD#"$HOME"}" ;; + *) printf %s "$PWD" ;; + esac + ;; + # VCS wrapper prompt function; print the first relevant prompt, if any vcs) typeset vcs @@ -169,7 +181,7 @@ prompt() { # Show return status of previous command in angle brackets, if not zero ret) - local ret=$2 + typeset ret=$2 ((ret)) && printf '<%u>' "$ret" ;; diff --git a/lint/ksh b/lint/ksh new file mode 100755 index 00000000..5c5445fc --- /dev/null +++ b/lint/ksh @@ -0,0 +1,2 @@ +#!/bin/sh +find ksh -type f -print -exec shellcheck -e SC1090 -s ksh -- {} \; diff --git a/lint/pdksh b/lint/pdksh deleted file mode 100755 index 03745b3d..00000000 --- a/lint/pdksh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -find pdksh -type f -print -exec shellcheck -e SC1090 -s ksh -- {} \; diff --git a/man/man1/rnds.1df b/man/man1/rnds.1df index 04e905d7..0a4dbc15 100644 --- a/man/man1/rnds.1df +++ b/man/man1/rnds.1df @@ -4,6 +4,7 @@ \- try to get a random seed .SH SYNOPSIS .B rnds +.br .B rnds 1024 .SH DESCRIPTION diff --git a/man/man1/xrbg.1df b/man/man1/xrbg.1df deleted file mode 100644 index 481c9185..00000000 --- a/man/man1/xrbg.1df +++ /dev/null @@ -1,19 +0,0 @@ -.TH XRBG 1df "March 2016" "Manual page for xrbg" -.SH NAME -.B xrbg -\- apply a random X background image with feh(1) -.SH SYNOPSIS -.B xrbg -.br -XBACKGROUNDS=/path/to/images -.B xrbg -.SH DESCRIPTION -.B xrbg -searches for images in the directory named in the XBACKGROUNDS environment -variable (defaults to ~/.xbackgrounds), chooses a random one with rndf(1df), -and applies it with feh(1). It's designed for use in ~/.xinitrc, but it seems -to work when called manually from within an X session too. -.SH SEE ALSO -feh(1), rndf(1df) -.SH AUTHOR -Tom Ryder <tom@sanctum.geek.nz> diff --git a/pdksh/pdkshrc b/pdksh/pdkshrc deleted file mode 100644 index 48799c2e..00000000 --- a/pdksh/pdkshrc +++ /dev/null @@ -1,13 +0,0 @@ -# Emacs-style key bindings -set -o braceexpand -set -o emacs - -# Save history -HISTFILE=$HOME/.pdksh_history -HISTSIZE=$((1 << 10)) - -# Load any supplementary scripts -for pdkshrc in "$HOME"/.pdkshrc.d/*.pdksh ; do - [[ -e $pdkshrc ]] && . "$pdkshrc" -done -unset -v pdkshrc diff --git a/sh/shrc.d/ksh.sh b/sh/shrc.d/ksh.sh index 046cd6c4..9cb72e8e 100644 --- a/sh/shrc.d/ksh.sh +++ b/sh/shrc.d/ksh.sh @@ -2,9 +2,7 @@ # configuration if it was defined or if we can find it. Bash and Zsh invoke # their own rc files first, which I've written to then look for ~/.shrc; ksh # does it the other way around. -case $KSH_VERSION in - *'PD KSH '*|*'MIRBSD KSH '*) - [ -f "${KSH_ENV:="$HOME"/.pdkshrc}" ] || return - . "$KSH_ENV" - ;; -esac +[ -n "$KSH_VERSION" ] || return +[ -n "$KSH_ENV" ] || KSH_ENV=$HOME/.kshrc +[ -f "$KSH_ENV" ] || return +. "$KSH_ENV" diff --git a/vim/after/ftdetect/sh.vim b/vim/after/ftdetect/sh.vim index 3bc10ba7..c974e293 100644 --- a/vim/after/ftdetect/sh.vim +++ b/vim/after/ftdetect/sh.vim @@ -9,7 +9,7 @@ augroup dfsh " Names/paths of things that are Korn shell script autocmd BufNewFile,BufRead - \ **/.dotfiles/pdksh/**,.pdkshrc,*.pdksh + \ **/.dotfiles/ksh/**,.kshrc,*.ksh \ let b:is_kornshell = 1 | \ setlocal filetype=sh diff --git a/zsh/zshrc.d/prompt.zsh b/zsh/zshrc.d/prompt.zsh index 0ac2be55..4b98c125 100644 --- a/zsh/zshrc.d/prompt.zsh +++ b/zsh/zshrc.d/prompt.zsh @@ -41,7 +41,7 @@ prompt() { # Bold and color the prompt if it looks like we can if (( $({ tput colors || tput Co ; } 2>/dev/null) >= 8 )) ; then - PS1='%B%F{green}'$PS1'%f%b' + PS1='%B%F{cyan}'$PS1'%f%b' fi # Add a space and define the rest of the prompts |