Shell: Update old TERM code

master
Pierre Neidhardt 2016-10-11 09:23:33 +05:30
parent f3c48de930
commit 40aba20b8c
3 changed files with 25 additions and 23 deletions

View File

@ -33,7 +33,7 @@ mkcd () {
cd "$1"
}
## Quick search.
## Quick search. More flexible alternative: 'ff -di'.
search () {
find . -iname "*$1*"
}

View File

@ -2,28 +2,18 @@
## Shell configuration
## Terminal
## WARNING: this is often a bad idea!
## WARNING: This is often a bad idea!
## FreeBSD urxvt $TERM variable is not set properly for some reasons.
if [ ! "$(uname -o)" = "GNU/Linux" ]; then
case "$TERM" in
*rxvt*) export TERM="rxvt-unicode-256color";;
esac
fi
# if [ ! "$(uname -o)" = "GNU/Linux" ]; then
# case "$TERM" in
# *rxvt*) export TERM="rxvt-unicode-256color";;
# esac
# fi
## Most xterm-based terminals support 256 colors, so let's turn this on.
if [ "$TERM" = "xterm" ]; then
export TERM="xterm-256color"
fi
## Enable color support of ls.
if [ "$TERM" != "dumb" ] && [ "$OSTYPE" = "linux-gnu" ]; then
eval "$(dircolors "$HOME/.shell.d/dircolorsdb")"
elif [ "$TERM" != "dumb" ]; then
export LSCOLORS="Ex"
# export LSCOLORS="ExfxcxDxCxdxdxCxCxECEh"
fi
## Title
## If this is an xterm set the title to user@host:dir
# if [ "$TERM" = "xterm" ]; then
# export TERM="xterm-256color"
# fi
## Title: If this is an xterm set the title to user@host:dir
#case "$TERM" in
#xterm*|rxvt*)
# PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
@ -31,3 +21,13 @@ fi
#*)
# ;;
#esac
## Enable color support of ls.
if [ "$TERM" != "dumb" ]; then
if [ "$OSTYPE" = "linux-gnu" ]; then
eval "$(dircolors "$HOME/.shell.d/dircolorsdb")"
else
export LSCOLORS="Ex"
# export LSCOLORS="ExfxcxDxCxdxdxCxCxECEh"
fi
fi

View File

@ -1,7 +1,7 @@
#!/bin/sh
## This file is sourced by some DM and should not contain any desktop execution.
## Internet browsers. They need X to run.
## Internet browsers that need X to run.
for i in qutebrowser dwb luakit chromium google-chrome; do
command -v $i >/dev/null 2>&1 && export BROWSER=$i && break
done
@ -29,7 +29,9 @@ fi
## This env variable is used by some programs (e.g. ranger, awesome) to get the
## terminal executable name.
export TERMCMD="urxvt"
for i in urxvt xterm; do
command -v $i >/dev/null 2>&1 && export TERMCMD=$i && break
done
## Hook. Should be sourced last.
[ -f ~/.xprofile_hook ] && . ~/.xprofile_hook