feat: tmux configuration

script: added script to create tmux workspace
tmux-config: sets dynamic variable defaultshell to tmux
This commit is contained in:
Zhongheng Liu 2024-12-07 19:23:58 +02:00
commit a2bf84b09e
Signed by: steven
GPG key ID: 805A28B071DAD84B
2 changed files with 9 additions and 5 deletions

View file

@ -6,7 +6,7 @@
}: { }: {
programs.tmux = { programs.tmux = {
enable = true; enable = true;
shell = "${pkgs.fish}/bin/fish"; shell = config.myShells.defaultShell;
terminal = "screen-256color"; # Fix for apps not recognising full color terminal = "screen-256color"; # Fix for apps not recognising full color
mouse = true; mouse = true;
plugins = with pkgs; [ plugins = with pkgs; [

View file

@ -6,9 +6,13 @@
windowName = "code-mode"; windowName = "code-mode";
in in
pkgs.writeShellScriptBin "tmux-code" '' pkgs.writeShellScriptBin "tmux-code" ''
#!/bin/sh #!${pkgs.bash}/bin/bash
${tmux}/bin/tmux new -s ${windowName} -d ${tmux}/bin/tmux has-session -t ${windowName} 2>/dev/null
${tmux}/bin/tmux send-keys -t ${windowName} nvim C-m if [ $? != 0 ]; then
${tmux}/bin/tmux split-window -h # setting up session
${tmux}/bin/tmux new -s ${windowName} -d
${tmux}/bin/tmux send-keys -t ${windowName} nvim C-m
${tmux}/bin/tmux split-window -h
fi
${tmux}/bin/tmux attach -t ${windowName} ${tmux}/bin/tmux attach -t ${windowName}
'' ''