. ../lib.sh
+
# Helper functions.
terminal_info() {
infocmp "$@" 2>&1
terminal_available() {
terminal_info "$@" > /dev/null
}
+grep_i() {
+ cmd_i grep "$@"
+}
# Check if `infocmp` is available.
if ! infocmp >/dev/null 2>&1; then
echo 'Warning: `infocmp` not available! 256color checks will fail.'
# "(ROOT)".
if test "`id -u`" -ne 0; then
echo screenrc: removing root options
- grep -v '(ROOT)' screenrc >screenrc.tmp
- mv screenrc.tmp screenrc
+ grep_i -v '(ROOT)' screenrc
fi
# I use some features of GNU screen which are only in Git or very recent GNU
# screen versions. Drop them on machines which have older versions. They are
# marked as "(GIT)".
if test ! -d "$HOME/development/shell/screen"; then
echo screenrc: removing Git features
- grep -v '(GIT)' screenrc >screenrc.tmp
- mv screenrc.tmp screenrc
+ grep_i -v '(GIT)' screenrc
fi
# Rxvt doesn't need the attrcolor "fix". As I prefer rxvt assume I use it when
# it's installed.
# are marked as "(BATTERY)".
if test ! -d /sys/class/power_supply/BAT0; then
echo screenrc: removing battery display
- grep -v '(BATTERY)' screenrc >screenrc.tmp
- mv screenrc.tmp screenrc
+ grep_i -v '(BATTERY)' screenrc
fi
if installed tmux; then