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 = {
enable = true;
shell = "${pkgs.fish}/bin/fish";
shell = config.myShells.defaultShell;
terminal = "screen-256color"; # Fix for apps not recognising full color
mouse = true;
plugins = with pkgs; [

View file

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