Selaa lähdekoodia

Use `version-compare` in tmux settings

Weiyi Lou 10 vuotta sitten
vanhempi
commit
ade1314aca
2 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 2 2
      tmux/tmux.conf
  2. 1 1
      tmux/tmuxcolours.conf

+ 2 - 2
tmux/tmux.conf

@@ -88,8 +88,8 @@ bind-key X kill-session
 # Remember prefix+$ for renaming sessions.
 
 # Version-specific configuration.
-if-shell '[[ `tmux -V | sed "s/[tmux |\.]//g"` < 21 ]]' 'source-file ~/dotfiles/tmux/tmux1.conf'
-if-shell '[[ `tmux -V | sed "s/[tmux |\.]//g"` -ge 21 ]]' 'source-file ~/dotfiles/tmux/tmux2.conf'
+if-shell '[[ $(version-compare $(tmux -V | sed "s/[tmux ]//g") 2.1) -lt 0 ]]' 'source-file ~/dotfiles/tmux/tmux1.conf'
+if-shell '[[ $(version-compare $(tmux -V | sed "s/[tmux ]//g") 2.1) -ge 0 ]]' 'source-file ~/dotfiles/tmux/tmux2.conf'
 
 # Colours and status line.
 source-file ~/dotfiles/tmux/tmuxcolours.conf

+ 1 - 1
tmux/tmuxcolours.conf

@@ -50,4 +50,4 @@ set-option -g display-panes-colour colour166 #orange
 # clock
 set-window-option -g clock-mode-colour colour64 #green
 
-if-shell '[[ `tmux -V | sed "s/[tmux |\.]//g"` -ge 21 ]]' 'source-file ~/dotfiles/tmux/tmuxcolours2.conf'
+if-shell '[[ $(version-compare $(tmux -V | sed "s/[tmux ]//g") 2.1) -ge 0 ]]' 'source-file ~/dotfiles/tmux/tmuxcolours2.conf'