]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - shell/setup.sh
htoprc: automatically switch to 4-column CPU layout
[config/dotfiles.git] / shell / setup.sh
index 7db9722ad9a5b20fb71dc8d188793404595f6640..9f622f71494031bd86fb8c2de4a9f8a6a1ce8a76 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.
@@ -228,6 +233,9 @@ 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.