]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - shell/setup.sh
shell: set GOTOOLCHAIN=local
[config/dotfiles.git] / shell / setup.sh
index 4276b42f67eb6393730900305f9092a570e1d05f..edb209ffc0b16444d520259053c82a411936b260 100755 (executable)
@@ -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 <lesskey \
+cp lesskey lesskey.tmp
+if ! less --help | grep rscroll= > /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.
@@ -122,7 +127,15 @@ else
     sed_i '/^alias grep=/ s/^/#/' shell/aliases
 fi
 
+if ! lsblk --merge >/dev/null 2>&1; then
+    echo 'shell/aliases: removing lsblk --merge'
+    sed_i 's/lsblk --merge/lsblk/' shell/aliases
+fi
+
 generate screenrc .in cat
+# Use absolute path for "shell" option for proper $SHELL variable.
+apply_optional_replacement screenrc \
+    zsh ZSH "`installed_path zsh`"
 # As screen-256color is not widely supported use it only on machines where the
 # matching terminfo entry is available. This also requires a terminal emulator
 # which supports 256 colors. Also used for tmux.
@@ -228,12 +241,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