Clean up formatting, added awman coloring, only use powerline if not using a TTY

This commit is contained in:
David Thurstenson 2016-04-11 12:27:46 -05:00
parent 73d31d2973
commit 148ef39a6f
2 changed files with 23 additions and 21 deletions

View File

@ -8,5 +8,6 @@
# Set numlock if running in tty. # Set numlock if running in tty.
# (numlock for X is set in ~/.xinitrc) # (numlock for X is set in ~/.xinitrc)
case $(tty) in /dev/tty[0-9]*) case $(tty) in /dev/tty[0-9]*)
setleds -D +num ;; setleds -D +num
export USING_TTY=1 ;;
esac esac

41
.bashrc
View File

@ -9,12 +9,12 @@
[[ $- != *i* ]] && return [[ $- != *i* ]] && return
# Use powerline if it's installed # Use powerline if it's installed
if [[ -s /usr/lib/python3.5/site-packages/powerline/bindings/bash/powerline.sh ]];then [ -z "$USING_TTY" -a -s "/usr/lib/python3.5/site-packages/powerline/bindings/bash/powerline.sh" ] && {
powerline-daemon -q powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1 POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1 POWERLINE_BASH_SELECT=1
. /usr/lib/python3.5/site-packages/powerline/bindings/bash/powerline.sh . /usr/lib/python3.5/site-packages/powerline/bindings/bash/powerline.sh
fi }
# Don't put duplicate lines or lines starting with space in the history. # Don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options # See bash(1) for more options
@ -25,16 +25,10 @@ LS_COLORS='di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43:su=0;4
export LS_COLORS export LS_COLORS
# Prefer vim, but if it's not installed, nano will do # Prefer vim, but if it's not installed, nano will do
if [[ -s /usr/bin/vim ]]; then [[ -s /usr/bin/vim ]] && export EDITOR=vim || export EDITOR=nano
export EDITOR=vim
else
export EDITOR=nano
fi
# Enable pkgfile to automatically search for packages if pkgfile is installed # Enable pkgfile to automatically search for packages if pkgfile is installed
if [[ -s /usr/share/doc/pkgfile/command-not-found.bash ]];then [[ -s /usr/share/doc/pkgfile/command-not-found.bash ]] && source /usr/share/doc/pkgfile/command-not-found.bash
source /usr/share/doc/pkgfile/command-not-found.bash
fi
# If a directory is given without any # If a directory is given without any
# command, CD into it. # command, CD into it.
@ -52,6 +46,18 @@ man() {
man "$@" man "$@"
} }
# Do the same for awman
awman() {
env LESS_TERMCAP_mb=$'\E[01;31m' \
LESS_TERMCAP_md=$'\E[01;38;5;74m' \
LESS_TERMCAP_me=$'\E[0m' \
LESS_TERMCAP_se=$'\E[0m' \
LESS_TERMCAP_so=$'\E[38;5;246m' \
LESS_TERMCAP_ue=$'\E[0m' \
LESS_TERMCAP_us=$'\E[04;38;5;146m' \
awman "$@"
}
### PROMPT ### ### PROMPT ###
@ -88,13 +94,8 @@ alias nmap='sudo -E nmap'
# Client depends: ssh, mosh, correct ssh host configuration # Client depends: ssh, mosh, correct ssh host configuration
# Server depends: ssh, mosh, screen, weechat, weechat.service (custom) # Server depends: ssh, mosh, screen, weechat, weechat.service (custom)
# Only do this if weechat isn't installed and you aren't thurstylark-vps # If you don't have weechat installed, connect to the existing screen session through mosh
if [[ ! -s /usr/bin/weechat ]]; then [[ ! -s /usr/bin/weechat ]] && alias weechat='mosh vps -- screen -dr weechat'
# Connect to the existing screen session through mosh # If you are thurstylark-vps, connect to the existing screen session locally
# (disconnecting it elsewhere if necessary) [[ "$HOSTNAME" = "thurstylark-vps" ]] && alias weechat='screen -dr weechat'
alias weechat='mosh vps -- screen -dr weechat'
elif [[ "$HOSTNAME" -eq "thurstylark-vps" ]]; then
# Connect to the existing screen session locally
# (disconnecting it elsewhere if necessary)
alias weechat='screen -dr weechat'
fi