feat: tmux configuration
script: added script to create tmux workspace tmux-config: sets dynamic variable defaultshell to tmux
This commit is contained in:
parent
712e45ca58
commit
a2bf84b09e
2 changed files with 9 additions and 5 deletions
|
@ -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; [
|
||||||
|
|
|
@ -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 has-session -t ${windowName} 2>/dev/null
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
# setting up session
|
||||||
${tmux}/bin/tmux new -s ${windowName} -d
|
${tmux}/bin/tmux new -s ${windowName} -d
|
||||||
${tmux}/bin/tmux send-keys -t ${windowName} nvim C-m
|
${tmux}/bin/tmux send-keys -t ${windowName} nvim C-m
|
||||||
${tmux}/bin/tmux split-window -h
|
${tmux}/bin/tmux split-window -h
|
||||||
|
fi
|
||||||
${tmux}/bin/tmux attach -t ${windowName}
|
${tmux}/bin/tmux attach -t ${windowName}
|
||||||
''
|
''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue