Set TMUX shell based on condition
This commit is contained in:
15
nix/home.nix
15
nix/home.nix
@@ -533,6 +533,7 @@ in
|
|||||||
plugins = with pkgs; [ tmuxPlugins.cpu ];
|
plugins = with pkgs; [ tmuxPlugins.cpu ];
|
||||||
prefix = "C-s";
|
prefix = "C-s";
|
||||||
terminal = "tmux-256color";
|
terminal = "tmux-256color";
|
||||||
|
shell = if isLinux then "${pkgs.zsh}/bin/zsh" else "/bin/zsh";
|
||||||
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
|
bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
|
||||||
@@ -641,6 +642,13 @@ in
|
|||||||
set -o vi
|
set -o vi
|
||||||
export EDITOR="nvim";
|
export EDITOR="nvim";
|
||||||
export PS1="\n[\[\e[37m\]\u\[\e[0m\]@\[\e[37;2m\]\h\[\e[0m\]] \[\e[1m\]\w \[\e[0;2m\]J:\[\e[0m\]\j\n\$ ";
|
export PS1="\n[\[\e[37m\]\u\[\e[0m\]@\[\e[37;2m\]\h\[\e[0m\]] \[\e[1m\]\w \[\e[0;2m\]J:\[\e[0m\]\j\n\$ ";
|
||||||
|
|
||||||
|
if [[ -z $TMUX ]]; then
|
||||||
|
tmux attach
|
||||||
|
if [[ $? == 1 ]]; then
|
||||||
|
tmux new -s main
|
||||||
|
fi
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -672,6 +680,13 @@ in
|
|||||||
|
|
||||||
set -o vi
|
set -o vi
|
||||||
export EDITOR="nvim";
|
export EDITOR="nvim";
|
||||||
|
|
||||||
|
if [[ -z $TMUX ]]; then
|
||||||
|
tmux attach
|
||||||
|
if [[ $? == 1 ]]; then
|
||||||
|
tmux new -s main
|
||||||
|
fi
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user