]> Sergey Matveev's repositories - dotfiles.git/commitdiff
Simplify dc invocation
authorSergey Matveev <stargrave@stargrave.org>
Mon, 3 May 2021 13:38:56 +0000 (16:38 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 3 May 2021 13:38:56 +0000 (16:38 +0300)
bin/bin/dc-wrapped.sh
bin/bin/tmux-menu-calc.sh
zsh/.zshrc

index 64211fce9d0551cbf2622f4520ba88df51907d6b..74d4af713c50e2a32065630c8f4786c4e6c5c843 100755 (executable)
@@ -2,10 +2,13 @@
 
 # natural logarithm: 1000lLx 10lLx /p
 # sum of everything in stack: lSxp
-pre="5k 10o
-[1-d2+/d2*Skd*Sy0Ss10K^Sp[d1r/lk*ls+lsrdss-lp*d*1[s_q]s_>_lkly*sk2+lfx]Sf1lfxLsLkLyLpLfs_s_s_s_]sL
+pre="5k 10o \
+[1-d2+/d2*Skd*Sy0Ss10K^Sp[d1r/lk*ls+lsrdss-lp*d*1[s_q]s_>_lkly*sk2+lfx]Sf1lfxLsLkLyLpLfs_s_s_s_]sL \
 [0d[+2z>a]salax]sS
 "
-
-sleep 0.01 # do not know why, but only with it it works in tmux menu
-exec rlwrap --history-filename /tmp/.dc_history --substitute-prompt "> " --pre-given "$pre" dc
+exec rlwrap \
+    --history-filename /tmp/.dc_history \
+    --substitute-prompt "> " \
+    --prompt-colour=red \
+    --wait-before-prompt -1 \
+    --pre-given "$pre" dc
index 6710019428a44b7a2ee08fa7b5c429bef3184179..24319b255a4c006b918190d6872571d172c02e3a 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 tmux has-session -t calc || {
-    tmux new-session -d -s calc ~/bin/dc-wrapped.sh
+    tmux new-session -d -s calc ~/bin/zc
     tmux set-option -t calc status off
 }
 exec tmux attach-session -t calc
index d109213a429eecdf1dd30c2e5b4a7bf4b6b9ed2d..7a8164246d6bcbe571e7dc24ad85b34a8d16dc3c 100644 (file)
@@ -84,7 +84,6 @@ alias -g M="| less"
 alias -g W="| wc -l | sed 's/ //g'"
 alias mc="mc --nomouse"
 alias sent="mutt -f =sent-\`date '+%y-%m'\`"
-alias zc=~/bin/dc-wrapped.sh
 
 f() {
     # find . -name "*$1*" -print