X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=blobdiff_plain;f=shell%2Fsetup.sh;h=9f622f71494031bd86fb8c2de4a9f8a6a1ce8a76;hp=394c46310d8c0001e53cb686e9e9f0bcd3f30353;hb=873ae3e69abd451545ec860598dcd0ec21881ca1;hpb=8800a6c2fd5b1025a0441ecaa0dd108c78f66eb7 diff --git a/shell/setup.sh b/shell/setup.sh index 394c463..9f622f7 100755 --- a/shell/setup.sh +++ b/shell/setup.sh @@ -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. @@ -185,7 +190,10 @@ fi apply_optional_replacement screenrc \ temperature TEMPERATURE "$temperature" # Settings for local hosts. -if test -z "${SSH_CONNECTION:+set}"; then +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 @@ -225,12 +233,21 @@ fi # Htop overwrites the comments in its configuration file. generate htoprc .in cat +if installed nproc && test "$(nproc)" -gt 8; then + sed_i 's/LeftCPUs/LeftCPUs2/; s/RightCPUs/RightCPUs2/' htoprc +fi if installed dig; then # dig doesn't support any comments in digrc. 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