X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=blobdiff_plain;f=shell%2Fsetup.sh;h=e8cff62e78da7cfd79b6fc429779fd9ba12e9bd0;hp=ef74ba130f083bf7343e0d60251074e583280cdd;hb=3e7a01c3a9d7c71a9e4a1981815efe54f7ed282e;hpb=9b3eafc30b98d228485b9687406b1a5d2c54f5c6 diff --git a/shell/setup.sh b/shell/setup.sh index ef74ba1..e8cff62 100755 --- a/shell/setup.sh +++ b/shell/setup.sh @@ -2,7 +2,7 @@ # Setup script for shell configuration files. -# Copyright (C) 2011-2014 Simon Ruderich +# Copyright (C) 2011-2018 Simon Ruderich # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -67,9 +67,14 @@ mkdir -p zsh/cache # file in this directory; this requires replacing the constant HISTORY_PATH in # lesskey. echo 'lesskey: generating .lesskey' -simple_cpp /dev/null; then + sed_i 's/--rscroll=[^ ]*//' lesskey.tmp +fi +simple_cpp < lesskey.tmp \ HISTORY_PATH -- "`pwd`/lesshistory" \ | lesskey - +rm lesskey.tmp chmod 0600 ~/.less # Custom colors for GNU ls. @@ -161,12 +166,6 @@ if test -z "$use_256colors"; then sed_i 's/Enable 256 color/Disable 256 color/; s/screen-256color/screen/' screenrc fi -# Some options are only necessary when running as root. They are marked as -# "(ROOT)". -if test "`id -u`" -ne 0; then - echo 'screenrc: removing root options' - grep_i -v '(ROOT)' screenrc -fi # Rxvt doesn't need the attrcolor "fix". As I prefer rxvt assume I use it when # it's installed. if installed rxvt; then @@ -190,6 +189,14 @@ if ! test -d "$temperature"; then fi apply_optional_replacement screenrc \ temperature TEMPERATURE "$temperature" +# Settings for local hosts. +if test -n "${SSH_CONNECTION:+set}"; then + echo 'screenrc: using dark blue for remote screens' + sed_i 's/sorendition = Bw/sorendition = bw/' screenrc +else + echo 'screenrc: removing remote options' + grep_i -v '(REMOTE)' screenrc +fi if installed tmux; then @@ -232,6 +239,12 @@ if installed dig; then grep -v -E '^#' digrc.in >digrc fi +_iptables='/usr/share/zsh/functions/Completion/Linux/_iptables' +if test -f "$_iptables"; then + sed '/^#compdef/ s/iptables/& ip6tables/' \ + < "$_iptables" \ + > zsh/functions/_iptables +fi # LINK SETUP